Skip to content

Commit 5959919

Browse files
authored
Reset border styles in Tailwind compatibility package (#3132)
1 parent 65d1964 commit 5959919

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

.changeset/dull-penguins-pump.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@astrojs/starlight-tailwind': patch
3+
---
4+
5+
Fixes an issue where all border styles were not reset by the Starlight’s Tailwind compatibility package like in [Tailwind base styles](https://tailwindcss.com/docs/preflight#border-styles-are-reset).

packages/tailwind/__tests__/tailwind.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ test('generates base and utilities CSS layers and defines default theme values',
1414
"@layer theme;
1515
1616
@layer base {
17+
*, :after, :before {
18+
border: 0 solid;
19+
}
20+
1721
html, :host {
1822
font-family: var(--font-sans);
1923
}

packages/tailwind/tailwind.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929

3030
@layer base {
3131
/* Restore crucial styles from Tailwind Preflight: https://tailwindcss.com/docs/preflight */
32+
/* Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116) */
33+
*,
34+
::after,
35+
::before {
36+
border: 0 solid;
37+
}
3238
/* Keep base font-family styles even in non-Starlight pages. */
3339
html,
3440
:host {

0 commit comments

Comments
 (0)