Skip to content

Commit 9bc3d50

Browse files
authored
Info hint background and link color fixes (#2953)
1 parent b5e4fd7 commit 9bc3d50

File tree

3 files changed

+24
-13
lines changed

3 files changed

+24
-13
lines changed

.changeset/rich-terms-smoke.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'gitbook': patch
3+
---
4+
5+
Info hint background and link color fixes

packages/gitbook/src/components/DocumentView/Hint.tsx

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -104,20 +104,22 @@ const HINT_STYLES: {
104104
'[&_.can-override-text]:text-neutral-strong',
105105
],
106106
container:
107-
'bg-neutral theme-muted:bg-neutral-base theme-bold-tint:bg-neutral-base theme-gradient:bg-neutral-12/1 border-neutral',
108-
containerWithHeader: 'border-info-solid bg-neutral-subtle theme-gradient:bg-neutral-12/1',
107+
'bg-info border-info theme-muted-tint:bg-info-solid/2 theme-bold-tint:bg-info-solid/2',
108+
containerWithHeader: 'border-info-solid bg-info-subtle',
109109
},
110110
warning: {
111111
icon: 'circle-exclamation',
112112
iconColor: 'text-warning-subtle contrast-more:text-warning',
113113
header: 'bg-warning-active',
114114
body: [
115115
'text-neutral-strong',
116-
'[&_a]:text-warning',
117-
'[&_a:hover]:text-warning-strong',
116+
'links-default:[&_a]:text-warning',
117+
'links-default:[&_a]:hover:text-warning-strong',
118+
'links-default:[&_a]:decoration-warning/6',
119+
'links-accent:[&_a]:decoration-warning',
120+
'decoration-warning/6',
118121
'[&_.can-override-bg]:bg-warning-active',
119122
'[&_.can-override-text]:text-warning-strong',
120-
'decoration-warning/6',
121123
],
122124
container: 'bg-warning border-warning',
123125
containerWithHeader: 'border-warning-solid bg-warning-subtle',
@@ -128,11 +130,13 @@ const HINT_STYLES: {
128130
header: 'bg-danger-active',
129131
body: [
130132
'text-neutral-strong',
131-
'[&_a]:text-danger',
132-
'[&_a:hover]:text-danger-strong',
133+
'links-default:[&_a]:text-danger',
134+
'links-default:[&_a]:hover:text-danger-strong',
135+
'links-default:[&_a]:decoration-danger/6',
136+
'links-accent:[&_a]:decoration-danger',
137+
'decoration-danger/6',
133138
'[&_.can-override-bg]:bg-danger-active',
134139
'[&_.can-override-text]:text-danger-strong',
135-
'decoration-danger/6',
136140
],
137141
container: 'bg-danger border-danger',
138142
containerWithHeader: 'border-danger-solid bg-danger-subtle',
@@ -143,11 +147,13 @@ const HINT_STYLES: {
143147
header: 'bg-success-active',
144148
body: [
145149
'text-neutral-strong',
146-
'[&_a]:text-success',
147-
'[&_a:hover]:text-success-strong',
150+
'links-default:[&_a]:text-success',
151+
'links-default:[&_a]:hover:text-success-strong',
152+
'links-default:[&_a]:decoration-success/6',
153+
'links-accent:[&_a]:decoration-success',
154+
'decoration-success/6',
148155
'[&_.can-override-bg]:bg-success-active',
149156
'[&_.can-override-text]:text-success-strong',
150-
'decoration-success/6',
151157
],
152158
container: 'bg-success border-success',
153159
containerWithHeader: 'border-success-solid bg-success-subtle',

packages/gitbook/src/components/primitives/StyledLink.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ export function StyledLink(props: Omit<LinkProps, 'style'> & { style?: ClassValu
1313
{...rest}
1414
className={tcls(
1515
'underline',
16-
'decoration-from-font',
16+
'decoration-[max(0.07em,1px)]', // Set the underline to be proportional to the font size, with a minimum. The default is too thin.
1717
'underline-offset-2',
1818
'links-accent:underline-offset-4',
1919

2020
'links-default:decoration-primary/6',
2121
'links-default:text-primary-subtle',
22-
'links-default:hover:text-primary',
22+
'links-default:hover:text-primary-strong',
2323
'links-default:contrast-more:text-primary',
2424
'links-default:contrast-more:hover:text-primary-strong',
2525

0 commit comments

Comments
 (0)