Skip to content

Commit 6199d59

Browse files
committed
feat: improve style isolation without breaking things
1 parent 8aaf109 commit 6199d59

File tree

6 files changed

+21
-11
lines changed

6 files changed

+21
-11
lines changed

src/styles/core.css

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* Core styles for Carbon Visualizer extension */
22

33
:where(#carbon-visualizer-welcome-panel,
4-
#carbon-visualizer-welcome-panel *,
5-
#carbon-visualizer-welcome-panel *::before,
6-
#carbon-visualizer-welcome-panel *::after) {
7-
all: initial;
4+
#carbon-visualizer-welcome-panel *,
5+
#carbon-visualizer-welcome-panel *::before,
6+
#carbon-visualizer-welcome-panel *::after) {
7+
all: revert;
88
}
99

1010
/* TODO: these green values were generated using https://oklchroma.utilitybend.com/ and are not part of any design specs.
@@ -29,6 +29,16 @@
2929
/* neutrals */
3030
--cv-black: hsl(0deg 0% 0%);
3131
--cv-white: hsl(0deg 0% 100%);
32+
33+
font-family: var(--cv-font-family-sans);
34+
35+
:where(h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dt, figure, blockquote) {
36+
line-height: calc(1em + 0.5rem);
37+
38+
&:not(:first-child) {
39+
margin-block-start: 1em;
40+
}
41+
}
3242
}
3343

3444
.cv-panel {

src/styles/generic/typography.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.cv {
1+
#carbon-visualizer-welcome-panel {
22
* {
33
max-inline-size: var(--cv-max-line-length);
44
}

src/styles/themes/default.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.cv,
1+
#carbon-visualizer-welcome-panel,
22
[data-theme] {
33
/* set up light and dark mode colors */
44
/* don't use these directly in components */

src/styles/tokens/color.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.cv {
1+
#carbon-visualizer-welcome-panel {
22
--cv-color-pink: oklch(50.0% 0.200 345);
33
--cv-color-pink-base: 0.05;
44
--cv-color-pink-10: oklch(from var(--cv-color-pink) 10% calc(var(--cv-color-pink-base) + (sin(1.0 * pi) * c)) h);

src/styles/tokens/size.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.cv {
1+
#carbon-visualizer-welcome-panel {
22
--cv-page-gutter: 1.5rem;
33
--cv-max-content-width: 75rem;
44
--cv-max-line-length: 72ch;

src/styles/tokens/typography.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
.cv {
1+
#carbon-visualizer-welcome-panel {
22
/* somewhat randomly selected system font stacks from https://modernfontstacks.com/ (replace as needed) */
33
--cv-font-family-display: Bahnschrift, 'DIN Alternate', 'Franklin Gothic Medium', 'Nimbus Sans Narrow', sans-serif-condensed, sans-serif;
44
--cv-font-family-sans: Seravek, 'Gill Sans Nova', Ubuntu, Calibri, 'DejaVu Sans', source-sans-pro, sans-serif;
5-
--cv-font-family-serif: Avenir, Montserrat, Corbel, 'URW Gothic', source-sans-pro, sans-serif;
5+
--cv-font-family-serif: Rockwell, 'Rockwell Nova', 'Roboto Slab', 'DejaVu Serif', 'Sitka Small', serif;
66
--cv-font-family-mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
77

88
/* commonly needed font sizes, named for what they're used for (avoiding overly specific names like h1, h2, etc.) */
99
--cv-font-size-display-lg: 7.25rem;
1010
--cv-font-size-display-md: 5.5rem;
1111
--cv-font-size-display-sm: 4rem;
12-
--cv-font-size-heading-xxl: 3rem;
12+
--cv-font-size-heading-xxl: 2.75rem;
1313
--cv-font-size-heading-xl: 2.25rem;
1414
--cv-font-size-heading-lg: 1.75rem;
1515
--cv-font-size-heading-md: 1.25rem;

0 commit comments

Comments
 (0)