Skip to content

Commit

Permalink
refactor table & range input mixins
Browse files Browse the repository at this point in the history
  • Loading branch information
basher committed Nov 11, 2024
1 parent c97fc03 commit 3c3ac0e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 28 deletions.
9 changes: 2 additions & 7 deletions ui/src/css/components/_tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Dependencies.
@use '../base' as *;
@use '../mixins' as *;

// Define mixin so tables inside prose content can be styled without requiring CSS class to be added.
@mixin table {
table,
.table {
:is(th, td) {
border: var(--border-width-s) solid hsl(var(--color-neutral-900) / 10%);
padding: var(--gutter-m);
Expand All @@ -25,11 +25,6 @@ Dependencies.
caption {
margin-block-end: var(--gutter-xs);
}
}

table,
.table {
@include table;

// Responsive wrapper.
&-wrapper[role='region'][tabindex] {
Expand Down
31 changes: 10 additions & 21 deletions ui/src/css/web-components/_webui-range-input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,6 @@ Dependencies.
--slider-height: 0.25rem;
}

@mixin slider-thumb {
background-color: $color-brand;
block-size: var(--icon-size-l);
border: 0;
border-radius: 50%;
inline-size: var(--icon-size-l);
}

@mixin slider-track {
background-color: hsl(var(--color-text) / 20%);
block-size: var(--slider-height);
}

webui-range-input {
output {
margin-inline: auto;
Expand All @@ -35,20 +22,22 @@ webui-range-input {
padding-inline: 0;

&::-webkit-slider-thumb {
@include slider-thumb;
-webkit-appearance: none;
margin-block-start: calc(var(--slider-height) * -3);
}

&::-webkit-slider-runnable-track {
@include slider-track;
}

&::-webkit-slider-thumb,
&::-moz-range-thumb {
@include slider-thumb;
background-color: $color-brand;
block-size: var(--icon-size-l);
border: 0;
border-radius: 50%;
inline-size: var(--icon-size-l);
margin-block-start: calc(var(--slider-height) * -3);
}

&::-webkit-slider-runnable-track,
&::-moz-range-track {
@include slider-track;
background-color: hsl(var(--color-text) / 20%);
block-size: var(--slider-height);
}
}

0 comments on commit 3c3ac0e

Please sign in to comment.