Skip to content

Commit

Permalink
Update styles for grouped formats
Browse files Browse the repository at this point in the history
  • Loading branch information
stacyk committed Nov 13, 2023
1 parent 4d60df1 commit 41aa529
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
11 changes: 8 additions & 3 deletions src/lib/components/colors/FormatGroup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</script>

<div data-content="format-group">
<h5>{formatGroup.name}</h5>
<h2 class="label section-heading">{formatGroup.name}</h2>
{#if !isInGamut}
<span data-color-info="warning"
>Selected color is <ExternalLink
Expand All @@ -39,7 +39,12 @@
</div>

<style lang="scss">
[data-color-info='warning'] {
grid-area: message;
[data-content~='format-group'] {
--heading-transform: none;
column-gap: var(--gutter);
display: grid;
grid-template-columns: auto 1fr;
margin-block-end: var(--double-gutter);
}
</style>
8 changes: 4 additions & 4 deletions src/lib/components/colors/Formats.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@
</script>

<div data-content="formats" data-column="tool">
<h4 class="small-only label">{displayType} Color</h4>
<h2 class="small-only label">{displayType} Color</h2>
{#each otherFormats as formatGroup}
<FormatGroup {type} {color} {formatGroup} />
{/each}
</div>

<style lang="scss">
[data-content~='formats'] {
margin-bottom: var(--double-gutter);
margin-block-end: var(--double-gutter);
}
.label {
--label-margin-bottom: var(--gutter);
.small-only {
margin-block-end: var(--gutter);
}
</style>
12 changes: 5 additions & 7 deletions src/lib/components/colors/Output.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,13 @@
</ul>

<style lang="scss">
[data-group~='output'] {
grid-column: 1 / -1;
}
li {
column-gap: 1ch;
display: grid;
grid-template:
'copy color' auto
'copy message' 3ex / auto 1fr;
}
[data-color-info='value'] {
grid-area: color;
grid-template-columns: auto 1fr;
}
</style>
5 changes: 2 additions & 3 deletions src/sass/initial/_type.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@

h1,
h2,
h3,
h4 {
h3 {
font-weight: normal;
margin: 0;
}
Expand All @@ -49,7 +48,7 @@ h4 {
.section-heading {
@include heading;

--label-margin-bottom: var(--gutter-plus);
--label-margin-bottom: var(--gutter);

@include config.below('sm-page-break') {
--heading-size: var(--medium);
Expand Down

0 comments on commit 41aa529

Please sign in to comment.