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

Support for fallback values #27

Closed
layershifter opened this issue Feb 9, 2022 · 1 comment · Fixed by #52
Closed

Support for fallback values #27

layershifter opened this issue Feb 9, 2022 · 1 comment · Fixed by #52
Assignees
Labels
💅 enhancement New feature or request

Comments

@layershifter
Copy link
Member

layershifter commented Feb 9, 2022

If a browser doesn’t recognize a property or its corresponding value, the browser will ignore the property altogether. When this happens, the browser uses (or falls back) to the previous value it finds.

This is the easiest way to provide a fallback. Here’s an example:

.layout {
  display: block;
  display: grid;
}

In this example, browsers that support CSS Grid will use display: grid. Browser doesn’t support CSS Grid will fall back to display: block.

https://zellwk.com/blog/older-browsers-css/


As we use objects to declare styles we can't simply do:

// ⚠️ this is not real code, this does not work
makeStyles({
  root: {
    color: "red",
    color: "rgba(0, 0, 0, 0.5)"
  }
});

We can use the similar approach as fela-plugin-fallback-value with arrays or something else.

The approach to fallback values should be tested and documented.

@layershifter layershifter added the 💅 enhancement New feature or request label Feb 14, 2022
@miroslavstastny miroslavstastny self-assigned this Feb 17, 2022
@miroslavstastny
Copy link
Member

Maybe not a big deal with evergreen browsers as it used to be with IE 11 which we do not support.
But there are still cases, like overflow-overlay where the fallback values still make sense.

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