Skip to content

Commit d561dba

Browse files
fix: ShadCN: inherit <a> styling for inline content (#1228)
* fix: ShadCN: inherit <a> styling for inline content By default, links are not styled when using ShadCN (and therefore hard to recognise). This patch makes them inherit the browser default, matching the Mantine behaviour. * Overwrote link styles instead of removing them * Added comment * Updated comment * Updated screenshots * Updated screenshots --------- Co-authored-by: matthewlipski <[email protected]>
1 parent 6239f98 commit d561dba

File tree

5 files changed

+32
-26
lines changed

5 files changed

+32
-26
lines changed

packages/shadcn/src/style.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@
7474
@apply bn-bg-background bn-text-foreground;
7575
}
7676

77+
.bn-shadcn .bn-editor a {
78+
color: revert;
79+
text-decoration: revert;
80+
}
81+
7782
.bn-shadcn [data-radix-popper-content-wrapper] {
7883
z-index: 99999 !important;
7984
}

packages/shadcn/src/tailwindStyles.css

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/* Based on https://stackoverflow.com/questions/63761312/how-to-scope-tailwind-css/69999793#69999793*/
1+
/* Based on https://stackoverflow.com/questions/63761312/how-to-scope-tailwind-css/69999793#69999793 */
2+
/* Should not be modified as the styles are taken directly from TailwindCSS */
23
.bn-shadcn {
34
/*
45
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
@@ -36,22 +37,22 @@
3637
-moz-tab-size: 4; /* 3 */
3738
tab-size: 4; /* 3 */
3839
font-family: theme(
39-
"fontFamily.sans",
40-
ui-sans-serif,
41-
system-ui,
42-
sans-serif,
43-
"Apple Color Emoji",
44-
"Segoe UI Emoji",
45-
"Segoe UI Symbol",
46-
"Noto Color Emoji"
40+
"fontFamily.sans",
41+
ui-sans-serif,
42+
system-ui,
43+
sans-serif,
44+
"Apple Color Emoji",
45+
"Segoe UI Emoji",
46+
"Segoe UI Symbol",
47+
"Noto Color Emoji"
4748
); /* 4 */
4849
font-feature-settings: theme(
49-
"fontFamily.sans[1].fontFeatureSettings",
50-
normal
50+
"fontFamily.sans[1].fontFeatureSettings",
51+
normal
5152
); /* 5 */
5253
font-variation-settings: theme(
53-
"fontFamily.sans[1].fontVariationSettings",
54-
normal
54+
"fontFamily.sans[1].fontVariationSettings",
55+
normal
5556
); /* 6 */
5657
-webkit-tap-highlight-color: transparent; /* 7 */
5758
}
@@ -130,23 +131,23 @@
130131
samp,
131132
pre {
132133
font-family: theme(
133-
"fontFamily.mono",
134-
ui-monospace,
135-
SFMono-Regular,
136-
Menlo,
137-
Monaco,
138-
Consolas,
139-
"Liberation Mono",
140-
"Courier New",
141-
monospace
134+
"fontFamily.mono",
135+
ui-monospace,
136+
SFMono-Regular,
137+
Menlo,
138+
Monaco,
139+
Consolas,
140+
"Liberation Mono",
141+
"Courier New",
142+
monospace
142143
); /* 1 */
143144
font-feature-settings: theme(
144-
"fontFamily.mono[1].fontFeatureSettings",
145-
normal
145+
"fontFamily.mono[1].fontFeatureSettings",
146+
normal
146147
); /* 2 */
147148
font-variation-settings: theme(
148-
"fontFamily.mono[1].fontVariationSettings",
149-
normal
149+
"fontFamily.mono[1].fontVariationSettings",
150+
normal
150151
); /* 3 */
151152
font-size: 1em; /* 4 */
152153
}
-93 Bytes
Loading
15 Bytes
Loading
-145 Bytes
Loading

0 commit comments

Comments
 (0)