-
Notifications
You must be signed in to change notification settings - Fork 293
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
base: master
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 53ec657 The changes in this PR will be included in the next version bump. This PR includes changesets to release 28 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.
@askoufis addressed the feedback + improved documentation. |
not a real issue |
looks like it wasn't an issue in the parcel, apparently Should be good to merge |
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. |
This PR adds support for CSS @property feature.
createVar
- creates a@property
definition, returns property var formatvar(--propertyName)
createGlobalVar
- same ascreateVar
but with a predefined namegetVarName
- accepts a property var format and returns just a property namevar(--propertyName)
->--propertyName
example: