-
Notifications
You must be signed in to change notification settings - Fork 3k
WIP: Update tailwind to version 4.0.0 #5990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,6 +1,15 @@ | ||||||
@import "tailwindcss/base"; | ||||||
@import "tailwindcss/components"; | ||||||
@import "tailwindcss/utilities"; | ||||||
/* See the Tailwind configuration guide for advanced usage | ||||||
https://tailwindcss.com/docs/configuration */ | ||||||
|
||||||
@import "tailwindcss"; | ||||||
@plugin "@tailwindcss/forms"; | ||||||
@plugin "./tailwind_heroicons.js"; | ||||||
@variant phx-click-loading ([".phx-click-loading&", ".phx-click-loading &"]); | ||||||
@variant phx-submit-loading ([".phx-submit-loading&", ".phx-submit-loading &"]); | ||||||
@variant phx-change-loading ([".phx-change-loading&", ".phx-change-loading &"]); | ||||||
@theme { | ||||||
--color-brand: "#FD4F00", | ||||||
}; | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @leifmetcalf I just tested this again with Tailwind 4.0.6 and the plugin seems to work now. The only issue I had was that Tailwind complained There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry, false alarm. I still had a node_modules folder lying around in a parent directory. So the plugin is still broken, but we need to fix the semicolon nonetheless. |
||||||
/* | ||||||
* Make LiveView wrapper divs transparent for layout. | ||||||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const plugin = require("tailwindcss/plugin") | ||
const fs = require("fs") | ||
const path = require("path") | ||
|
||
module.exports = plugin(function({matchComponents, theme}) { | ||
let iconsDir = path.join(__dirname, "../..<%= if @in_umbrella, do: "/../.." %>/deps/heroicons/optimized") | ||
let values = {} | ||
let icons = [ | ||
["", "/24/outline"], | ||
["-solid", "/24/solid"], | ||
["-mini", "/20/solid"], | ||
["-micro", "/16/solid"] | ||
] | ||
icons.forEach(([suffix, dir]) => { | ||
fs.readdirSync(path.join(iconsDir, dir)).forEach(file => { | ||
let name = path.basename(file, ".svg") + suffix | ||
values[name] = {name, fullPath: path.join(iconsDir, dir, file)} | ||
}) | ||
}) | ||
matchComponents({ | ||
"hero": ({name, fullPath}) => { | ||
let content = fs.readFileSync(fullPath).toString().replace(/\r?\n|\r/g, "") | ||
content = encodeURIComponent(content) | ||
let size = theme("spacing.6") | ||
if (name.endsWith("-mini")) { | ||
size = theme("spacing.5") | ||
} else if (name.endsWith("-micro")) { | ||
size = theme("spacing.4") | ||
} | ||
return { | ||
[`--hero-${name}`]: `url('data:image/svg+xml;utf8,${content}')`, | ||
"-webkit-mask": `var(--hero-${name})`, | ||
"mask": `var(--hero-${name})`, | ||
"mask-repeat": "no-repeat", | ||
"background-color": "currentColor", | ||
"vertical-align": "middle", | ||
"display": "inline-block", | ||
"width": size, | ||
"height": size | ||
} | ||
} | ||
}, {values}) | ||
}) |
Uh oh!
There was an error while loading. Please reload this page.