Skip to content

Commit

Permalink
Fix description list color
Browse files Browse the repository at this point in the history
  • Loading branch information
angelikatyborska committed Jul 2, 2024
1 parent addc0f0 commit 491371b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions lib/bitstyles_phoenix/bitstyles.ex
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ defmodule BitstylesPhoenix.Bitstyles do

class =
case class do
"u-fg-grayscale-dark-2" -> "u-fg-text-darker"
"u-fg-grayscale" -> "u-fg-text"
class -> class
end
Expand Down
12 changes: 6 additions & 6 deletions lib/bitstyles_phoenix/component/description_list.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ defmodule BitstylesPhoenix.Component.DescriptionList do
"""
<dl class="a-dl">
<div class="a-dl__item u-grid@m u-grid-cols-3 u-gap-l u-padding-m-y u-padding-m@m u-items-baseline">
<dt class="u-font-medium u-h6 u-fg-text-darker u-margin-s4-bottom@s">
<dt class="u-font-medium u-h6 u-fg-grayscale-dark-2 u-margin-s4-bottom@s">
Length
</dt>
<dd class="u-col-span-2">
8
</dd>
</div>
<div class="a-dl__item u-grid@m u-grid-cols-3 u-gap-l u-padding-m-y u-padding-m@m u-items-baseline">
<dt class="u-font-medium u-h6 u-fg-text-darker u-margin-s4-bottom@s">
<dt class="u-font-medium u-h6 u-fg-grayscale-dark-2 u-margin-s4-bottom@s">
Inserted at
</dt>
<dd class="u-col-span-2">
Expand Down Expand Up @@ -64,23 +64,23 @@ defmodule BitstylesPhoenix.Component.DescriptionList do
"""
<dl class="a-dl extra" data-foo="baz">
<div class="a-dl__item u-grid@m u-grid-cols-3 u-gap-l u-padding-m-y u-padding-m@m u-items-baseline u-fg-brand-2">
<dt class="u-font-medium u-h6 u-fg-text-darker u-margin-s4-bottom@s">
<dt class="u-font-medium u-h6 u-fg-grayscale-dark-2 u-margin-s4-bottom@s">
Length
</dt>
<dd class="u-col-span-2">
8
</dd>
</div>
<div class="a-dl__item u-grid@m u-grid-cols-3 u-gap-l u-padding-m-y u-padding-m@m u-items-baseline">
<dt class="u-font-medium u-h6 u-fg-text-darker u-margin-s4-bottom@s u-fg-brand-1" data-foo="bar">
<dt class="u-font-medium u-h6 u-fg-grayscale-dark-2 u-margin-s4-bottom@s u-fg-brand-1" data-foo="bar">
Some
</dt>
<dd class="u-col-span-2 u-fg-brand-1" data-foo="bar">
Tag
</dd>
</div>
<div class="a-dl__item u-grid@m u-grid-cols-3 u-gap-l u-padding-m-y u-padding-m@m u-items-baseline">
<dt class="u-font-medium u-h6 u-fg-text-darker u-margin-s4-bottom@s">
<dt class="u-font-medium u-h6 u-fg-grayscale-dark-2 u-margin-s4-bottom@s">
<pre>
Tag
</pre>
Expand Down Expand Up @@ -162,7 +162,7 @@ defmodule BitstylesPhoenix.Component.DescriptionList do
assigns = assign(assigns, extra: extra)

~H"""
<dt class={classnames(["u-font-medium u-h6 u-fg-text-darker u-margin-s4-bottom@s", assigns[:class]])} {@extra}>
<dt class={classnames(["u-font-medium u-h6 u-fg-grayscale-dark-2 u-margin-s4-bottom@s", assigns[:class]])} {@extra}>
<%= render_slot(@inner_block) %>
</dt>
"""
Expand Down
2 changes: 2 additions & 0 deletions test/bitstyles_phoenix/bitstyles_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ defmodule BitstylesPhoenix.BitstylesTest do
assert classname("u-content--l", "6.0.0") == "u-content--l"

assert classname("u-fg-grayscale", "6.0.0") == "u-fg-grayscale"
assert classname("u-fg-grayscale-dark-2", "6.0.0") == "u-fg-grayscale-dark-2"
end

test "version 5.0.0" do
Expand Down Expand Up @@ -72,6 +73,7 @@ defmodule BitstylesPhoenix.BitstylesTest do
assert classname("u-content--l", "5.0.0") == "u-content--l"

assert classname("u-fg-grayscale", "5.0.0") == "u-fg-text"
assert classname("u-fg-grayscale-dark-2", "5.0.0") == "u-fg-text-darker"
end

test "version 4.3.0" do
Expand Down

0 comments on commit 491371b

Please sign in to comment.