-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add tailwindcss #29357
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
Merged
Merged
Add tailwindcss #29357
Changes from 9 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
d3298c1
Add tailwindcss
silverwind f580ecf
add prefix
silverwind d8bf9f1
fix comment
silverwind 947537e
add devtest sample
silverwind dc70632
showcase with conditionals
silverwind 0b7dd57
move our helpers after tailwind to allow overrides
silverwind 82bdb9f
exclude devtest in production builds
silverwind d8ec072
fix warning
silverwind c94ff46
remove inaccurate type
silverwind d9b5216
move colors calculation inline
silverwind a0c70f9
revert test
silverwind 045dd1d
fix lint, adjust comment
silverwind e140a2b
save one level of indentation with arrow function
silverwind 783545d
lint
silverwind 37398e3
export an object again for editor integration compat
silverwind 6a81686
fix name for currentcolor
silverwind 30c7478
move tailwind demo to end
silverwind e68bb68
wording
silverwind 15cd6e0
Merge branch 'main' into tailwind
GiteaBot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import {readFileSync} from 'node:fs'; | ||
import {parse} from 'css-variables-parser'; | ||
|
||
const colors = Object.keys(parse([ | ||
readFileSync(new URL('web_src/css/themes/theme-gitea-light.css', import.meta.url), 'utf8'), | ||
readFileSync(new URL('web_src/css/themes/theme-gitea-dark.css', import.meta.url), 'utf8'), | ||
].join('\n'), {})).filter((prop) => prop.startsWith('color-')).map((prop) => prop.substring(6)); | ||
|
||
export default function ({isProduction}) { | ||
return { | ||
prefix: 'tw-', | ||
content: [ | ||
isProduction && '!./templates/devtest/**/*', | ||
isProduction && '!./web_src/js/standalone/devtest.js', | ||
'./templates/**/*.tmpl', | ||
'./web_src/**/*.{js,vue}', | ||
].filter(Boolean), | ||
blocklist: [ | ||
// classes that don't work without CSS variables from "@tailwind base" which we don't use | ||
'transform', 'shadow', 'ring', 'blur', 'grayscale', 'invert', '!invert', 'filter', '!filter', | ||
'backdrop-filter', | ||
// false-positives or otherwise unneeded | ||
'[-a-zA-Z:0-9_.]', | ||
], | ||
theme: { | ||
colors: { | ||
// make `tw-bg-red` etc work with our CSS variables | ||
...Object.fromEntries(colors.map((color) => [color, `var(--color-${color})`])), | ||
inherit: 'inherit', | ||
currentcolor: 'currentcolor', | ||
transparent: 'transparent', | ||
}, | ||
}, | ||
}; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.