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

Updates to compiled stylesheet #825

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading