Skip to content

Commit

Permalink
Merge pull request #1525 from cozy/feat/fontWeight
Browse files Browse the repository at this point in the history
feat: Add font-weight to styleguide
  • Loading branch information
JF-Cozy authored Aug 24, 2020
2 parents 4d960ec + 0d2e327 commit 73d5b53
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 6 deletions.
27 changes: 22 additions & 5 deletions stylus/cozy-ui/build.styl
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,23 @@ Display an chip that represents complex identity
Styleguide utilities.text.fontstyle
*/

/*
Font-weight
Sets a font-weight to a text<br>
[Can be used with breakpoints modifier suffixes (`-t`,`-s`,`-m`)](section-settings.html#kssref-settings-breakpoints)
Markup:
<p class="{{modifier_class}}">Facilisis eget nam turpis id adipiscing facilisi odio ut fames, aliquet laoreet felis habitasse tincidunt litora leo senectus.</p>
.u-fw-normal - Sets a normal font weight
.u-fw-bold - Sets a bold font weight
Weight: 9
Styleguide utilities.text.fontweight
*/

/*
Text alignement
Expand All @@ -903,7 +920,7 @@ Display an chip that represents complex identity
.u-ta-center - Sets a center alignment
.u-ta-justify - Sets a justify alignment
Weight: 9
Weight: 10
Styleguide utilities.text.alignment
*/
Expand All @@ -919,7 +936,7 @@ Display an chip that represents complex identity
.u-ellipsis - Ellipsis at the end
Weight: 10
Weight: 11
Styleguide utilities.text.ellipsis
*/
Expand All @@ -936,7 +953,7 @@ Display an chip that represents complex identity
.u-spacellipsis - Ellipsis at the end but keeps breaking spaces
Weight: 11
Weight: 12
Styleguide utilities.text.spacellipsis
*/
Expand All @@ -953,7 +970,7 @@ Display an chip that represents complex identity
.u-midellipsis - Ellipsis in the middle
Weight: 12
Weight: 13
Styleguide utilities.text.midellipsis
*/
Expand All @@ -967,7 +984,7 @@ Display an chip that represents complex identity
.u-link - Link style
Weight: 13
Weight: 14
Styleguide utilities.text.link
*/
Expand Down
16 changes: 15 additions & 1 deletion stylus/utilities/text.styl
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,25 @@ fontstyle = {
'fs-normal': 'fs-normal',
'fs-italic': 'fs-italic'
}

if cssmodules == true
cssModulesUtils(fontstyle, breakpoints)
else
nativeUtils(fontstyle, breakpoints)

fw-normal()
font-weight normal

fw-bold()
font-weight bold

fontweight = {
'fw-normal': 'fw-normal',
'fw-bold': 'fw-bold'
}
if cssmodules == true
cssModulesUtils(fontweight, breakpoints)
else
nativeUtils(fontweight, breakpoints)
// @stylint on

// Global classes
Expand Down

0 comments on commit 73d5b53

Please sign in to comment.