diff --git a/src/lib/components/ratio/ColorIssues.svelte b/src/lib/components/ratio/ColorIssues.svelte index a40abbe..73817be 100644 --- a/src/lib/components/ratio/ColorIssues.svelte +++ b/src/lib/components/ratio/ColorIssues.svelte @@ -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 { diff --git a/src/sass/patterns/_disclosure.scss b/src/sass/patterns/_disclosure.scss new file mode 100644 index 0000000..6dd1852 --- /dev/null +++ b/src/sass/patterns/_disclosure.scss @@ -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); + } + } +} diff --git a/src/sass/patterns/_index.scss b/src/sass/patterns/_index.scss index 85b59cb..902cbf1 100644 --- a/src/sass/patterns/_index.scss +++ b/src/sass/patterns/_index.scss @@ -7,4 +7,5 @@ @forward 'buttons'; @forward 'icons'; @forward 'lists'; +@forward 'disclosure'; @forward 'themes'; diff --git a/src/sass/patterns/_lists.scss b/src/sass/patterns/_lists.scss index edd5bce..50f9143 100644 --- a/src/sass/patterns/_lists.scss +++ b/src/sass/patterns/_lists.scss @@ -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;