-
Notifications
You must be signed in to change notification settings - Fork 296
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
add support for css @property
#1092
Conversation
🦋 Changeset detectedLatest commit: f7d017a The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Thanks for the PR! This looks really great. To me this is just an extension of our current So I think we'd need to make the following changes for now:
|
hey @markdalgleish, thanks for your feedback! Updated the code, pls let me know if I need to change something else |
@markdalgleish thanks for cleaning this up! is there something I should address before merging? |
@markdalgleish any updates here, i'm really waiting for this feature? |
This would be a nice addition. Currently I can only use properties using globalStyle with a @ts-ignore. That feels a bit dirty globalStyle(`@property --headerBackground1`, {
// @ts-ignore
syntax: `'<color>'`,
initialValue: colorPrimitives.neutrals.whites.W100,
inherits: false,
}); |
I'd like to bump this and see it land! 🙏 This would be a great feature for our design system to use. |
Need this as well, any update to this PRs future @markdalgleish? |
I am also needing this in our current library. Any update? |
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.
Hey, I'm keen to help get this PR through the door. For me, there's a few things still missing.
Testing @property
CSS output in a fixture
Your example in examples/next
is somewhat complex, and isn't actually being tested anywhere. We snapshot screenshots and CSS output of each of the fixture
packages, so maybe adding a simple property in the themed
fixture would be enough.
Unit testing CSS output
This is done in transformCss.test.ts
. You probably just need to add a single test case that uses an object with type: 'property'
.
Docs
We tend to be a bit particular about docs, so that can be left to a separate PR. However, you're more than welcome try write them yourself if you want.
@z4o4z Hey, are you still interested in getting this PR over the line? If not, I may look at picking it up myself in the near future. |
hey @askoufis, i've added tests and updated docs. let me know if that looks good for you :) Thanks for helping with the PR! |
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.
Thanks for picking this up again @z4o4z, it's most of the way there. For me the last missing bit is docs for createGlobalVar
, which should be fairly straightforward. I've also made a comment about keyframes
below.
Once the last bits are ready there's also some playwright snapshots that need updating.
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.
Thanks for the quick updates. Just some more minor comments from me.
Also realised there's no changesets for the features. We'll need one for There's actually a few more changes that need changeesets. I'll add them.createVar
and createGlobalVar
, as well as a separate one for adding vars
support to keyframes
.
@markdalgleish Would you mind giving this another review when you've got some time? |
Looks like linting is also failing, specifically |
@askoufis thanks for the feedback! addressed everything |
hey @askoufis @markdalgleish any chance we can merge it soon? |
Bump. |
Bump |
bump! I just need this one as well ;) |
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.
I had a small handful of tweaks I wanted to make. Was going to push them to your fork but I don't have permission to do so (I think because it's the default branch of a fork). I've instead made suggestions for the changes and will commit them.
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.
Seems like I can't run CI on your @z4o4z Really appreciate your work and everyone's patience on this feature. Thank you!master
fork. I will merge this and fix up anything that breaks in a subsequent PR.
packages/rollup-plugin/test/__snapshots__/rollup-plugin.test.ts.snap
Outdated
Show resolved
Hide resolved
This has been released in |
yay! |
This PR adds support for CSS @property feature.
createVar
- overloaded to allow a@property
definition, returns property var formatvar(--propertyName)
createGlobalVar
- same ascreateVar
but with a global (non-scoped) nameexample: