-
Notifications
You must be signed in to change notification settings - Fork 667
☂️ CSS Prefix: Missing Properties #1423
Comments
Currently working on supporting the |
We should create a script file that creates and updates the prefix visitors. Like we do for |
I'm currently working export default ["box-shadow", "-webkit-box-shadow", "-moz-box-shadow"].map((
value
) => {
createPrefixVisitor({
name: "box-shadow",
enter(path) {
return prefixCSSProperty({
path,
propertyName: value,
browserFeaturesKey: "css-boxshadow",
});
}
})
}) Or is there a better way to handle this using |
is not required, prefixes are automatically added. I'll update the post to make it clearer.
|
Ah alright, thanks for the help! |
How should I handle running the tests while #1424 isn't merged? Because it just generates the exact same output at the moment because the new prefix hasn't been added to the main file. Would it make sense to add it manually (and update the hash), or just wait until it's merged? |
It's just been merged 😄. |
I've opened a pull request with |
I can work on |
i'm working on the edit: hum, it's already part of https://github.com/rome/tools/blob/main/internal/compiler/transforms/compile/css-handler/prefix/prefixes/transform.ts#L27 so not need to do something more? |
I opened a PR with position support, hope it's fine ;) |
Indeed thanks for the catch, I'll remove it from the list.
Great thanks! |
I've opened a PR with |
@jer3m01 @ematipico Do you mind if I make a pr with multiple properties? |
No problem go ahead! As long as you include them clearly in the description of the PR. |
I can work on |
i will work on |
Working on |
Hi there! I ran tests using @jer3m01 or anyone else who can help, I would really appreciate it as I am a beginner. |
@grimxreaper The Unfortunately the stack trace doesn't help. You could try to open a draft PR. From there we can help. |
@ematipico |
@grimxreaper after writing your @ematipico I don't think it's stated anywhere in the docs how to update the snapshots. I was confused about this too a few months ago, maybe it would be useful to write it somewhere. |
Thank you @JustBeYou that was helpful, 2 problems were found when I ran the command you suggested. Could you show me an example of tests you or others have written on this thread for their CSS prefixes? I actually don't see examples of any tests or test files in the code base...any examples available? |
@grimxreaper the idea here is not to write actual unit testing but to generate snapshots to automatically assure that the output does not change. Basically, the flow is as this:
It would be useless to actually write the output for the test case by hand. Generating the output, checking it is correct, and storing it for future testing are enough for assuring that future code wouldn't break the current code. If you need more details you could check out the team's discord. PS If I have a wrong understanding of the workflow, I'll be glad if someone from the core team could point it to me. |
working on |
I will work on Edit:
Perhaps the selectors can be reserved to be worked on by the team as well? Or am I missing something? Could use some hint on what I need to do, thanks! |
@lucasweng If it's alright, I could work on that as I have a rough idea about how it should be done. (I'm not from the core team btw) Working on |
@JustBeYou sure, and thanks for #1423 (comment)! |
Is there any more that need to be done here? I was going to take |
@reZach can you help with |
Working on |
@ematipico @jer3m01 Working on |
@imskr Hi! The |
Hi! Thank you for opening this issue We recently made the decision to migrate the Rome codebase to Rust and making some significant changes to its architecture. We've also decided not to release the previous version written in TypeScript. We're going through and closing pull requests and issues that were specific to the TypeScript codebase, including this one. Thank you for taking the time to open it. Thanks again! |
How To
Below is a list of properties missing from our current css prefix implementation.
Use
./script compiler-create-prefix [propertyName]
. thanks @ematipico!This will create:
internal/compiler/transforms/compile/css-handler/prefix/prefixes/[propertyName].ts
internal/compiler/transforms/compile/test-fixtures/css-handler/prefix/[propertyName]/input.css
website/src/docs/css-handler/prefix/[propertyName].md
They should all reference (using a link) at the top of their file (below imports) where the info came from.
Info like: property name, special values, ...
They should export an array of
createPrefixVisitor
s and return aprefixCSSProperty
orprefixCSSValue
(covers 99% use case, if not discuss prior).
Prefixes will automatically be added to the property/value.
If some values/properties have special names (such as
-moz-inline-flex
being-moz-inline-box
)use the
rename
argument as show here and here.Also be sure to test on https://autoprefixer.github.io/ for the same output. Don't forget to set target as
> 0%
.And write tests for them in
internal/compiler/transforms/compile/test-fixtures/css-handler/prefix/<PROPERTY NAME>/input.css
Examples
display, transform, transition.
Properties
Any
-ms-
(IE) only prefixes are not needed.Reference: https://github.com/postcss/autoprefixer/blob/main/data/prefixes.js
border-radius
and its derivatives @magsoutbox-shadow
@ajkachnicanimation
and its derivatives @magsouttransition
and its derivatives @jer3m01transform
@jer3m01box-sizing
@magsoutfilter
⚙️ @ajkachnicfilter()
Reservedelement()
Reservedbackdrop-filter
@magsoutmulticolumn
and its derivatives @jer3m01user-select
@ktfthdisplay
@jer3m01flex
and its derivatives ⚙️ @harxkicalc
⚙️ @jer3m01background-origin
,background-size
background-clip
⚙️ @luisgserranofont
and its derivativesborder-image
⚙️ @imskr:
file calledpseudo-classes
::
file calledpseudo-elements
hyphens
@ktfthtab-size
@UsamaHameedintrinsic-width
@JustBeYougrid
and its derivatives @UsamaHameedcursor
@ktfthposition
@magsouttext-decoration
and its derivatives ⚙️ @grimxreapertext-size-adjust
@harxkimask
and its derivatives @ktfthclip-path
@dctalbotbox-decoration-break
@alewinobject-fit
,object-position
⚙️ @imrishabh18shape
and its derivatives @sergeypriakhintext-overflow
@UsamaHameed@
file calledat-rules
Reservedtext-align-last
@bechirimage-rendering
*-inline-*
@ktfth*-block-*
@ktfthappearance
@UsamaHameedscroll-snap
and its derivatives @UsamaHameedflow-into
,flow-from
,region-fragment
list
and its derivatives ⚙️ @UsamaHameedgradient
and its derivatives, single file calledgradient
⚙️ @ktfthwriting-mode
@UsamaHameedtext-emphasis
and its derivatives @ktfthtext-spacing
⚙️ @thescriptedunicode-bidi
color-adjust
@thescriptedtext-orientation
@UsamaHameedimage-set
@ktfthReserved means a rule isn't easy to implement and is reserved to be worked on by the team.
A ⚙️ indicates they are being worked on.
A checkmark indicates an open PR.
If any are missing, don't hesitate to comment!
& Thanks for all contributions! 💛
(note to myself) once complete, recheck the reference for any missed ones & reduce test sizes
The text was updated successfully, but these errors were encountered: