Skip to content

Commit

Permalink
fix errors in compiled stylesheet (#825)
Browse files Browse the repository at this point in the history
  • Loading branch information
rezrah authored Nov 22, 2024
1 parent 0a41132 commit 2c8e924
Show file tree
Hide file tree
Showing 5 changed files with 2,917 additions and 64 deletions.
49 changes: 49 additions & 0 deletions .changeset/blue-ligers-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
'@primer/react-brand': minor
---

Switched to use CSS Logical Properties in compiled output.

- Compiled styles now directly use CSS logical properties (e.g., `margin-inline-start`, `margin-inline-end`) instead of physical properties (`margin-left`, `margin-right`).
- This change simplifies the stylesheet and reduces its overall size (`652kB` > `593kB`)

Example of the change:

Source:

```css
.selector {
margin-inline-start: var(--base-size-20);
}
```

<table>
<tr>
<th> Previous compiled output
</th> <th> New compiled output </th>
</tr>
<tr>
<td valign="top">

```css
[dir='ltr'] .selector {
margin-left: 2px;
}

[dir='rtl'] .selector {
margin-right: 2px;
}
```

</td>
<td valign="top">

```css
.selector {
margin-inline-start: 2px;
}
```

</td>
</tr>
</table>
5 changes: 5 additions & 0 deletions .changeset/chilly-ducks-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react-brand': patch
---

Fixed errors in compiled CSS stylesheets where selectors with special characters were being unintentionally escaped for compatibility with legacy browsers.
Loading

0 comments on commit 2c8e924

Please sign in to comment.