facebook / facebook/stylex

Transformed media queries leave gaps between breakpoints

Open
#1,793 0 comments 3 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
10.3k
Forks
481
Avg merge
3d 8h
Merged PRs (30d)
13

Description

### Describe the issue

Take this create call:
```js
const styles = stylex.create({
foo: {
gridColumn: {
default: '1 / 2',
'@media (width >= 48rem)': '1 / 3',
'@media (width >= 64rem)': '1 / -1',
},
},
});
```

It is now transformed at compile time to:
```js
const styles = stylex.create({
foo: {
gridColumn: {
default: '1 / 2',
'@media (width >= 48rem) and (width <= 63.99rem) ': '1 / 3',
'@media (width >= 64rem)': '1 / -1',
},
},
});
```

### Expected behavior
It should be transformed to:
```js
const styles = stylex.create({
foo: {
gridColumn: {
default: '1 / 2',
'@media (width >= 48rem) and (width < 64rem) ': '1 / 3',
'@media (width >= 64rem)': '1 / -1',
},
},
});
```

### Steps to reproduce

```js
const styles = stylex.create({
foo: {
gridColumn: {
default: '1 / 2',
'@media (width >= 48rem)': '1 / 3',
'@media (width >= 64rem)': '1 / -1',
},
},
});
```

### Test case

Input:
```js
const styles = stylex.create({
foo: {
gridColumn: {
default: '1 / 2',
'@media (width >= 48rem)': '1 / 3',
'@media (width >= 64rem)': '1 / -1',
},
},
});
```

Output:
```js
const styles = stylex.create({
foo: {
gridColumn: {
default: '1 / 2',
'@media (width >= 48rem) and (width < 64rem) ': '1 / 3',
'@media (width >= 64rem)': '1 / -1',
},
},
});
```

### Additional comments

_No response_

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.