Skip to content
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

feature(core): transform is expanded to 3 different vendor prefixes #379

Closed
ling1726 opened this issue Jun 6, 2023 · 4 comments · Fixed by #388
Closed

feature(core): transform is expanded to 3 different vendor prefixes #379

ling1726 opened this issue Jun 6, 2023 · 4 comments · Fixed by #388
Assignees
Labels
💅 enhancement New feature or request

Comments

@ling1726
Copy link
Member

ling1726 commented Jun 6, 2023

When using the css transform property, Griffel will expand this to include vendor prefixing for:

  • webkit
  • moz
  • ms (i.e 11 I guess?)

This results in a style rule that will have 4 times its length (including the actual transform) and negatively impacts bundlesize

@ling1726
Copy link
Member Author

ling1726 commented Jun 6, 2023

With the current browser compatibility, is it necessary to expand vendor prefixes in this case?
image

@ling1726 ling1726 self-assigned this Jun 6, 2023
@ling1726 ling1726 added the 💅 enhancement New feature or request label Jun 6, 2023
@layershifter
Copy link
Member

We need to do more that translate in this direction. For context, thysultan/stylis#283

What should be done?

@layershifter layershifter changed the title transform is expanded to 3 different vendor prefixes feature(core): transform is expanded to 3 different vendor prefixes Jun 8, 2023
@layershifter
Copy link
Member

layershifter commented Jul 12, 2023

Our base browser support matrix matches that the matrix in Fluent UI v9, https://react.fluentui.dev/?path=/docs/concepts-developer-browser-support-matrix--page


The list of polifilled scenarios and what can be removed:

  • 🟢 can be removed
  • 🟡 can be removed
  • 🔴 prefixing should stay
Scenario State Comment Source
display: flex, display: inline-flex, flex: * 🟢 ... https://developer.mozilla.org/en-US/docs/Web/CSS/flex
flex-grow: * 🟢 ... https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow
flex-shrink: * 🟢 ... https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink
flex-basis: * 🟢 ... https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis
align-self: * 🟢 All prefixed scenarios are supported https://developer.mozilla.org/en-US/docs/Web/CSS/align-self
align-content: * 🟢 All prefixed scenarios are supported https://developer.mozilla.org/en-US/docs/Web/CSS/align-content
align-items: * 🟢 All prefixed scenarios are supported https://developer.mozilla.org/en-US/docs/Web/CSS/align-items
justify-content: * 🟢 All prefixed scenarios are supported https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content
justify-items: * 🟢 ... https://developer.mozilla.org/en-US/docs/Web/CSS/justify-items
order 🟢 ... https://developer.mozilla.org/en-US/docs/Web/CSS/order
flex-direction: * 🟢 ... https://caniuse.com/?search=flex-direction
transform: * 🟢 ... https://developer.mozilla.org/en-US/docs/Web/CSS/transform
cursor: grab 🟢 ... https://caniuse.com/?search=cursor%3A%20grab
cursor: image-set() 🔴 Needs to be prefixed https://caniuse.com/?search=image-set
backface-visibility: * 🔴 Needs to be prefixed due Safari https://developer.mozilla.org/en-US/docs/Web/CSS/backface-visibility
transition: * 🟢 ... https://developer.mozilla.org/en-US/docs/Web/CSS/transition
writing-mode: * 🟢 ... https://developer.mozilla.org/en-US/docs/Web/CSS/writing-mode
columns*: * 🟢 ... https://developer.mozilla.org/en-US/docs/Web/CSS/columns
text-size-adjust: * 🟢 Support is limited, prefixing is not needed https://developer.mozilla.org/en-US/docs/Web/CSS/text-size-adjust
text-decoration: * 🟢 Shorthand is not supported in Safari, but prefixer does not do expansion https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration
mask:* 🔴 Prefixing is needed https://caniuse.com/?search=mask
filter:* 🟢 ... https://developer.mozilla.org/en-US/docs/Web/CSS/filter
position: sticky 🟢 ... https://caniuse.com/?search=position%3A%20sticky
color-adjust: * 🟡 Propery is "print-color-adjust", can be removed https://developer.mozilla.org/en-US/docs/Web/CSS/print-color-adjust
box-decoration-break:* 🔴 Should be prefixed https://developer.mozilla.org/en-US/docs/Web/CSS/box-decoration-break
clip-path:* 🟢 ... https://developer.mozilla.org/en-US/docs/Web/CSS/clip-path
height:fill-available 🟡 Deprecated, can be removed https://caniuse.com/?search=fill-available
width:fit-content 🟢 ... https://caniuse.com/?search=width%3Afit-content
width:min-block-size 🟢 .. https://caniuse.com/?search=min-block-size
width:stretch 🔴 ... https://caniuse.com/?search=width%3Astretch
max-height:fit-content 🟢 ... https://caniuse.com/?search=max-height
background:image-set 🔴 Prefixing required for Chrome https://caniuse.com/?search=background%3Aimage-set
background-clip:text 🟢 ... https://developer.mozilla.org/en-US/docs/Web/CSS/background-clip
margin-inline 🔴 Should be polifilled https://caniuse.com/?search=margin-inline
user-select: * 🔴 Should be polifilled because of Safari https://caniuse.com/?search=user-select
appearance:* 🔴 Should be poliffiled https://developer.mozilla.org/en-US/docs/Web/CSS/appearance
animation* 🟢 ... https://developer.mozilla.org/en-US/docs/Web/CSS/animation
display: grid, display: inline-grid, grid* 🟢 ... https://caniuse.com/?search=display%3Agrid
scroll-snap-type 🟢 All browsers in matrix support it https://caniuse.com/?search=scroll-snap-type
scroll-margin 🟢 Safari 14.1 has support for these properties https://caniuse.com/?search=scroll-margin-top
tab-size 🔴 Required, native support in Firefox landed in 91 https://caniuse.com/?search=tab-size

I don't see in tests of Stylis, but there is also prefixing for @keyframes, it should be also dropped.

@ling1726
Copy link
Member Author

ling1726 commented Jul 12, 2023

ling1726 added a commit that referenced this issue Jul 13, 2023
Copies the source from the [stylis prefixer](https://github.com/thysultan/stylis/blob/master/src/Prefixer.js)
and updates it so that prefixing is only applied according the the
browser support matrix. We follow the [browser support matrix](https://github.com/microsoft/fluentui/blob/master/rfcs/shared/build-system/06-browser-support-for-v9.md)
of Fluent UI

Fixes #379
@layershifter layershifter self-assigned this Jul 13, 2023
ling1726 added a commit that referenced this issue Jul 13, 2023
* feat: Prefix according to browser support matrix

Copies the source from the [stylis prefixer](https://github.com/thysultan/stylis/blob/master/src/Prefixer.js)
and updates it so that prefixing is only applied according the the
browser support matrix. We follow the [browser support matrix](https://github.com/microsoft/fluentui/blob/master/rfcs/shared/build-system/06-browser-support-for-v9.md)
of Fluent UI

Fixes #379

* Change files

* remote it.only

* silence warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💅 enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants