Below is a list of properties missing from our current css prefix implementation.
Use ./scripts compiler-create-prefix [propertyName]. thanks @ematipico!
This will create:
internal/compiler/transforms/compile/css-handler/prefix/prefixes/[propertyName].tsinternal/compiler/transforms/compile/test-fixtures/css-handler/prefix/[propertyName]/input.csswebsite/src/docs/css-handler/prefix/[propertyName].mdThey 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 createPrefixVisitors and return a prefixCSSProperty or prefixCSSValue
(covers 99% use case, if not discuss prior).
export default [
createPrefixVisitor({
name: "<PROPERTY NAME>", // <PROPERTY NAME>/<VALUE NAME>
enter(path) {
return prefixCSSValue({
path,
propertyName: "<PROPERTY NAME>",
value: "<VALUE NAME>", // Only for prefixCSSValue
browserFeaturesKey: "<PROPERTY DATA NAME>", // From `caniuse-db`
});
},
}),
// ...
];
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
display, transform, transition.
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 @jer3m01 box-sizing @magsoutfilter :gear: @ajkachnicbackdrop-filter @magsoutmulticolumn and its derivatives @jer3m01user-selectdisplay @jer3m01flex and its derivativescalc :gear: @jer3m01 background-origin, background-sizebackground-clipfont and its derivativesborder-image: file called pseudo-classes:: file called pseudo-elementshyphenstab-sizewidth and its derivativesheight and its derivativessize and its derivativesgrid and its derivativescursorposition @magsouttouch-actiontext-decoration and its derivativestext-size-adjustmask and its derivativesclip-pathbox-decoration-breakobject-fit, object-positionshape and its derivativestext-overflow@ file called at-rulestext-align-lastimage-renderingborder-inline-start, border-inline-endmargin-inline-start, margin-inline-endpadding-inline-start, padding-inline-endborder-block-start, border-block-endmargin-block-start, margin-block-endpadding-block-start, padding-block-endappearancescroll-snap and its derivativesflow-into, flow-from, region-fragmentlist and its derivativescontentgradient and its derivatives, single file called gradientwriting-modetext-emphasis and its derivativestext-spacingunicode-bidioverscroll-behaviorcolor-adjusttext-orientationA 鈿欙笍 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
Currently working on supporting the box-shadow property
We should create a script file that creates and updates the prefix visitors. Like we do for create-lint-rule. I will take care of it.
I'm currently working box-shadow, and to support the browser prefixes, I'd need to do something like this, right?
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 rename?
["box-shadow", "-webkit-box-shadow", "-moz-box-shadow"]
is not required, prefixes are automatically added.
Just return a single createPrefixVisitor (same code as our discussion on discord).
I'll update the post to make it clearer.
Or is there a better way to handle this using rename?
rename is only used in the case that a specific browser uses a custom name instead of the generic one.
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 box-shadow support!
I can work on filter. Since I know the process a lot more now, I should be able to add it fairly quickly
i'm working on the backface-visibility property. is that ok for you?
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 ;)
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?
Indeed thanks for the catch, I'll remove it from the list.
I opened a PR with position support, hope it's fine ;)
Great thanks!
I've opened a PR with box-sizing support
@jer3m01 @ematipico Do you mind if I make a pr with multiple properties?
@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.
Most helpful comment
It's just been merged 馃槃.