-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[v4] Support arbitrary gradient angles #13783
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonder if we should do this under a bg-linear
namespace instead of bg-gradient
but keep gradient for BC? That way we could also do bg-conic
and bg-radial
as well 🤔
You know… I'm totally on board with that. |
1e08ff2
to
877b994
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
2 questions:
- For the
bg-radial
examples, will we do that in a new PR or in the same PR? - This currently still allows you to type
bg-gradient-[123deg]
. Should we infer theangle
data type in the'bg'
plugin and just return early so we don't fallback tobackground-color
?
Something like:
diff --git a/packages/tailwindcss/src/utilities.ts b/packages/tailwindcss/src/utilities.ts
index 78d653b9d..53ac9a584 100644
--- a/packages/tailwindcss/src/utilities.ts
+++ b/packages/tailwindcss/src/utilities.ts
@@ -2532,9 +2532,13 @@ export function createUtilities(theme: Theme) {
'bg-size',
'length',
'url',
+ 'angle',
])
switch (type) {
+ // Explicitly unsupported
+ case 'angle':
+ return
case 'percentage':
case 'position': {
return [decl('background-position', value)]
Just for completeness so we don't forget: The last one I mentioned, where we infer the |
Yeah we need to do the proper fix but in a separate PR. It also doesn't need to land before this one so I'm gonna go ahead and merge this in. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just move that one changelog thing but otherwise rock and roll 🤘
This makes things like
bg-gradient-[125deg]
andbg-gradient-[1.3rad]
work. Now the output will be: