facebook / facebook/stylex

[babel-plugin] Enforce media query order

Open
#1,157 2 comments 2 reactions 1 assignee Claimed by @mellyeliu View on GitHub
enhancement
Dominant language
JavaScript
Stars
10.3k
Forks
481
Avg merge
3d 8h
Merged PRs (30d)
13

Description

### Describe the feature request

Documenting in-progress work to make media queries deterministic. Currently there is no way to guarantee media query order, and we have been working on tackling this

```
const styles = stylex.create({
foo: {
width: {
default: 500,
'@media (max-width: 1280px)': 420,
'@media (max-width: 768px)': '100%',
}
}
});
```

Becomes:

```
const styles = stylex.create({
foo: {
width: {
default: 500,
// '@media (max-width: 1280px) and not (max-width: 768px)': 420,
// simplified to:
'@media (min-width: 768.1px) and (max-width: 1280px)': 420,
'@media (max-width: 768px)': '100%',
}
}
});
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.