Skip to content

Commit 458ed69

Browse files
authored
feat(theme)!: add layer for base.css to support tailwind v4 (#2477)
1 parent d9e049d commit 458ed69

File tree

3 files changed

+67
-64
lines changed

3 files changed

+67
-64
lines changed
Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,76 @@
1-
@import url(./preflight.css);
2-
@tailwind components;
3-
@tailwind utilities;
1+
@import url(./preflight.css) layer(rp-base);
42

5-
html {
6-
line-height: 1.7;
7-
font-size: 16px;
8-
-webkit-text-size-adjust: 100%;
9-
scroll-padding-top: calc(
10-
var(--rp-nav-height) + var(--rp-sidebar-menu-height)
11-
);
12-
}
3+
@layer rp-base {
4+
html {
5+
line-height: 1.7;
6+
font-size: 16px;
7+
-webkit-text-size-adjust: 100%;
8+
scroll-padding-top: calc(
9+
var(--rp-nav-height) + var(--rp-sidebar-menu-height)
10+
);
11+
}
1312

14-
html.dark {
15-
color-scheme: dark;
16-
}
13+
html.dark {
14+
color-scheme: dark;
15+
}
1716

18-
body {
19-
margin: 0;
20-
width: 100%;
21-
min-width: 320px;
22-
font-family: var(--rp-font-family-base);
23-
font-size: 16px;
24-
font-weight: 400;
25-
color: var(--rp-c-text-1);
26-
background-color: var(--rp-c-bg);
27-
direction: ltr;
28-
font-synthesis: style;
29-
text-rendering: optimizeLegibility;
30-
-webkit-font-smoothing: antialiased;
31-
-moz-osx-font-smoothing: grayscale;
32-
}
17+
body {
18+
margin: 0;
19+
width: 100%;
20+
min-width: 320px;
21+
font-family: var(--rp-font-family-base);
22+
font-size: 16px;
23+
font-weight: 400;
24+
color: var(--rp-c-text-1);
25+
background-color: var(--rp-c-bg);
26+
direction: ltr;
27+
font-synthesis: style;
28+
text-rendering: optimizeLegibility;
29+
-webkit-font-smoothing: antialiased;
30+
-moz-osx-font-smoothing: grayscale;
31+
}
3332

34-
button:focus,
35-
button:focus-visible {
36-
outline: none;
37-
}
33+
button:focus,
34+
button:focus-visible {
35+
outline: none;
36+
}
3837

39-
h1,
40-
h2,
41-
h3,
42-
h4,
43-
h5,
44-
h6,
45-
li,
46-
p {
47-
overflow-wrap: break-word;
48-
}
38+
h1,
39+
h2,
40+
h3,
41+
h4,
42+
h5,
43+
h6,
44+
li,
45+
p {
46+
overflow-wrap: break-word;
47+
}
4948

50-
.visually-hidden {
51-
visibility: hidden;
52-
}
49+
.visually-hidden {
50+
visibility: hidden;
51+
}
5352

54-
.rspress-logo {
55-
height: 1.6rem;
56-
}
53+
.rspress-logo {
54+
height: 1.6rem;
55+
}
5756

58-
#nprogress .bar {
59-
background: var(--rp-c-brand);
60-
position: fixed;
61-
top: 0;
62-
left: 0;
63-
width: 100%;
64-
height: 2px;
65-
}
57+
#nprogress .bar {
58+
background: var(--rp-c-brand);
59+
position: fixed;
60+
top: 0;
61+
left: 0;
62+
width: 100%;
63+
height: 2px;
64+
}
6665

67-
/**
66+
/**
6867
* Custom font family
6968
*/
70-
:root {
71-
--rp-font-family-base:
72-
'Inter var experimental', 'Inter var', -apple-system, BlinkMacSystemFont,
73-
'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans',
74-
'Helvetica Neue', sans-serif;
75-
--rp-font-family-mono: Menlo, Monaco, Consolas, 'Courier New', monospace;
69+
:root {
70+
--rp-font-family-base:
71+
'Inter var experimental', 'Inter var', -apple-system, BlinkMacSystemFont,
72+
'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans',
73+
'Helvetica Neue', sans-serif;
74+
--rp-font-family-mono: Menlo, Monaco, Consolas, 'Courier New', monospace;
75+
}
7676
}

packages/theme-default/src/styles/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44
import './vars.css';
55
import './base.css';
6+
import './tailwind.css';
67
import './code.css';
78
import './scrollbar.scss';
89
import './shiki.scss';
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@tailwind components;
2+
@tailwind utilities;

0 commit comments

Comments
 (0)