Skip to content

Commit

Permalink
move disclosure styles to it's own partial, add fix for safari double…
Browse files Browse the repository at this point in the history
… marker
  • Loading branch information
stacyk committed Dec 21, 2023
1 parent 3887935 commit 5f35287
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 34 deletions.
21 changes: 0 additions & 21 deletions src/lib/components/ratio/ColorIssues.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -65,27 +65,6 @@
display: grid;
gap: var(--shim-plus);
grid-template-columns: max-content var(--triangle-height);
&::marker {
content: none;
}
&::before {
border-color: transparent transparent transparent currentColor;
border-style: solid;
border-width: var(--triangle-width) 0 var(--triangle-width)
var(--triangle-height);
content: '';
grid-column: 2;
grid-row: 1;
margin-block-start: var(--half-shim);
transform: rotate(0);
transition: transform 150ms;
}
}
[open] summary::before {
transform: rotate(90deg);
}
.issues-list {
Expand Down
42 changes: 42 additions & 0 deletions src/sass/patterns/_disclosure.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// The Details disclosure element
// ------------------------------

details {
--link: var(--fgcolor);
--link-focus: var(--fgcolor);

background-color: var(--status-result-bg, var(--bgcolor));
border-radius: var(--border-radius);
color: var(--status-result-fg, var(--fgcolor));
}

summary {
cursor: pointer;
font-weight: bold;

// Hides marker some browsers add
&::marker {
content: none;
}

// Hides marker webkit adds
&::-webkit-details-marker {
display: none;
}

&::before {
border-color: transparent transparent transparent currentColor;
border-style: solid;
border-width: var(--triangle-width) 0 var(--triangle-width)
var(--triangle-height);
content: '';
grid-column: 2;
grid-row: 1;
transform: rotate(0deg);
transition: all 1s ease-out 100ms;

[open] & {
transform: rotate(90deg);
}
}
}
1 change: 1 addition & 0 deletions src/sass/patterns/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
@forward 'buttons';
@forward 'icons';
@forward 'lists';
@forward 'disclosure';
@forward 'themes';
13 changes: 0 additions & 13 deletions src/sass/patterns/_lists.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,6 @@ li {
gap: var(--shim);
}

details {
--link: var(--fgcolor);
--link-focus: var(--fgcolor);

background-color: var(--status-result-bg, var(--bgcolor));
border-radius: var(--border-radius);
color: var(--status-result-fg, var(--fgcolor));
}

summary {
cursor: pointer;
font-weight: bold;
}

dl {
display: grid;
Expand Down

0 comments on commit 5f35287

Please sign in to comment.