Skip to content

Commit

Permalink
Add support for capitalize to text-transform (#2170)
Browse files Browse the repository at this point in the history
Co-authored-by: Cameron Dutro <camertron@gmail.com>
  • Loading branch information
Tonkpils and camertron authored Aug 1, 2023
1 parent 040daed commit 4391873
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .changeset/six-students-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@primer/view-components": patch
---

Add support for capitalize to text-transform

<!-- Changed components: Primer::BaseComponent -->
2 changes: 1 addition & 1 deletion app/components/primer/base_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class BaseComponent < Primer::Component
# | `font_style` | Symbol | Font style. <%= one_of([:italic]) %> |
# | `font_weight` | Symbol | Font weight. <%= one_of([:light, :normal, :bold, :emphasized]) %> |
# | `text_align` | Symbol | Text alignment. <%= one_of([:left, :right, :center]) %> |
# | `text_transform` | Symbol | Text transformation. <%= one_of([:uppercase]) %> |
# | `text_transform` | Symbol | Text transformation. <%= one_of([:uppercase, :capitalize]) %> |
# | `underline` | Boolean | Whether text should be underlined. |
# | `word_break` | Symbol | Whether to break words on line breaks. <%= one_of(Primer::Classify::Utilities.mappings(:word_break)) %> |
#
Expand Down
2 changes: 2 additions & 0 deletions lib/primer/classify/utilities.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1558,6 +1558,8 @@
:text_transform:
:uppercase:
- text-uppercase
:capitalize:
- text-capitalize
:text_align:
:right:
- text-right
Expand Down
2 changes: 2 additions & 0 deletions lib/tasks/custom_utilities.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
:text_transform:
:uppercase:
- text-uppercase
:capitalize:
- text-capitalize
:text_align:
:right:
- text-right
Expand Down
1 change: 1 addition & 0 deletions test/lib/classify_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ def test_font_style

def test_text_transform
assert_generated_class("text-uppercase", { text_transform: :uppercase })
assert_generated_class("text-capitalize", { text_transform: :capitalize })
end

def test_font_weight
Expand Down

0 comments on commit 4391873

Please sign in to comment.