Skip to content

Commit

Permalink
Use primary theme color as default tag color
Browse files Browse the repository at this point in the history
  • Loading branch information
spohlenz committed Aug 4, 2024
1 parent 13dcabe commit 3f887fc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/assets/bundle/trestle/admin.css

Large diffs are not rendered by default.

16 changes: 13 additions & 3 deletions frontend/css/components/_tags.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@
--tag-font-weight: normal;
--tag-line-height: 1.1;

--tag-bg: #{shift-color($primary, $tag-bg-scale)};
--tag-border-color: #{rgba(black, 0.25)};
--tag-color: white;

--tag-hover-border-color: #{rgba(black, 0.35)};
--tag-bg: #{shift-color($primary, $tag-bg-scale)};
--tag-border-color: #{$primary};

--tag-hover-bg: #{shift-color($primary, $tag-hover-bg-scale)};
--tag-hover-border-color: #{shift-color($primary, $tag-hover-border-scale)};

display: inline-block;
padding: var(--tag-padding-y) var(--tag-padding-x) var(--tag-padding-y) calc(var(--tag-padding-x) - var(--tag-border-width) / 2);
Expand Down Expand Up @@ -62,6 +64,14 @@
}
}

.tag {
--tag-bg: #{adjust-theme-hsl(primary, $lightness: -$tag-bg-scale)};
--tag-border-color: var(--primary);

--tag-hover-bg: #{adjust-theme-hsl(primary, $lightness: -$tag-hover-bg-scale)};
--tag-hover-border-color: #{adjust-theme-hsl(primary, $lightness: -$tag-hover-border-scale)};
}

@each $state, $value in $theme-colors {
.tag-#{$state} {
@include tag-variant($value);
Expand Down

0 comments on commit 3f887fc

Please sign in to comment.