Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for capitalize to text-transform #2170

Merged
merged 5 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
Tonkpils marked this conversation as resolved.
Show resolved Hide resolved
- 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
Loading