git.iko.soy/typeable/elm-ui
on master help sign in
remove disabling of a variant because I don't think it's actually needed.
3ba2e66Matthew Griffith
src/Element/Font.elm+5−25
@@ -5,7 +5,7 @@ module Element.Font exposing
5 , alignLeft, alignRight, center, justify, letterSpacing, wordSpacing
5 , alignLeft, alignRight, center, justify, letterSpacing, wordSpacing
6 , underline, strike, italic, unitalicized
6 , underline, strike, italic, unitalicized
7 , heavy, extraBold, bold, semiBold, medium, regular, light, extraLight, hairline
7 , heavy, extraBold, bold, semiBold, medium, regular, light, extraLight, hairline
8− , Variant, variant, smallCaps, slashedZero, ligatures, ordinal, tabularNumbers, stackedFractions, diagonalFractions, swash, disable, feature, indexed
8+ , Variant, variant, smallCaps, slashedZero, ligatures, ordinal, tabularNumbers, stackedFractions, diagonalFractions, swash, feature, indexed
9 , glow, shadow
9 , glow, shadow
10 )
10 )
11
11
@@ -73,7 +73,7 @@ module Element.Font exposing
73
73
74## Variants
74## Variants
75
75
76−@docs Variant, variant, smallCaps, slashedZero, ligatures, ordinal, tabularNumbers, stackedFractions, diagonalFractions, swash, disable, feature, indexed
76+@docs Variant, variant, smallCaps, slashedZero, ligatures, ordinal, tabularNumbers, stackedFractions, diagonalFractions, swash, feature, indexed
77
77
78
78
79## Shadows
79## Shadows
@@ -346,6 +346,7 @@ glow clr i =
346{- Variants -}
346{- Variants -}
347
347
348
348
349+{-| -}
349type alias Variant =
350type alias Variant =
350 Internal.Variant
351 Internal.Variant
351
352
@@ -359,6 +360,8 @@ type alias Variant =
359
360
360**Note** These will **not** stack. If you want multiple variants, you should use `Font.with`.
361**Note** These will **not** stack. If you want multiple variants, you should use `Font.with`.
361
362
363+If you specify a font variant on an element, then it will override all variants listed in `Font.with`.
364+
362-}
365-}
363variant : Variant -> Attribute msg
366variant : Variant -> Attribute msg
364variant var =
367variant var =
@@ -376,29 +379,6 @@ variant var =
376 ("\"" ++ name ++ "\" " ++ String.fromInt index)
379 ("\"" ++ name ++ "\" " ++ String.fromInt index)
377
380
378
381
379−{-| Less often you might want to disable an active variant.
380−
381− el
382− [ Font.variant (Font.disable Font.smallCaps)
383− ]
384− (text "Is not smallcaps")
385−
386−**Note** Generally try to set yourself up so that this isn't really necessary.
387−
388−-}
389−disable : Variant -> Variant
390−disable var =
391− case var of
392− Internal.VariantActive name ->
393− Internal.VariantOff name
394−
395− Internal.VariantIndexed name index ->
396− Internal.VariantOff name
397−
398− Internal.VariantOff name ->
399− var
400−
401−
402{-| [Small caps](https://en.wikipedia.org/wiki/Small_caps) are rendered using uppercase glyphs, but at the size of lowercase glyphs.
382{-| [Small caps](https://en.wikipedia.org/wiki/Small_caps) are rendered using uppercase glyphs, but at the size of lowercase glyphs.
403-}
383-}
404smallCaps : Variant
384smallCaps : Variant