-
Notifications
You must be signed in to change notification settings - Fork 197
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
Phantom types: background-repeat #411
Changes from 2 commits
9e33611
0434b76
2ec1021
1b28318
7acbcbd
4f3975e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,8 @@ module Css | |
, backgroundPosition | ||
, backgroundPosition2 | ||
, backgroundPosition4 | ||
, backgroundRepeat | ||
, backgroundRepeat2 | ||
, baseline | ||
, batch | ||
, before | ||
|
@@ -203,12 +205,16 @@ module Css | |
, rad | ||
, relative | ||
, rem | ||
, repeat | ||
, repeatX | ||
, repeatY | ||
, revert | ||
, rgb | ||
, rgba | ||
, ridge | ||
, right | ||
, right_ | ||
, round | ||
, rowResize | ||
, rtl | ||
, sResize | ||
|
@@ -230,6 +236,7 @@ module Css | |
, smaller | ||
, softLight | ||
, solid | ||
, space | ||
, stackedFractions | ||
, start | ||
, static | ||
|
@@ -359,10 +366,12 @@ All CSS properties can have the values `unset`, `initial`, and `inherit`. | |
|
||
## Background Image | ||
|
||
@docs backgroundImage, backgroundImages, backgroundPosition, backgroundPosition2, backgroundPosition4 | ||
@docs backgroundImage, backgroundImages, backgroundPosition, backgroundPosition2, backgroundPosition4, backgroundRepeat, backgroundRepeat2 | ||
|
||
@docs linearGradient, stop, stop2, toBottom, toBottomLeft, toBottomRight, toLeft, toRight, toTop, toTopLeft, toTopRight | ||
|
||
@docs repeat, repeatX, repeatY, space, round | ||
|
||
|
||
## Box Shadow | ||
|
||
|
@@ -3978,6 +3987,99 @@ backgroundPosition4 (Value horiz) (Value horizAmount) (Value vert) (Value vertAm | |
|
||
|
||
|
||
-- BACKGROUND REPEAT -- | ||
|
||
|
||
{-| Sets [`background-repeat`](https://css-tricks.com/almanac/properties/b/background-repeat/) | ||
|
||
backgroundRepeat repeat | ||
|
||
backgroundRepeat repeatX | ||
|
||
If you need to set horizontal and vertical direction separately, see | ||
[`backgroundRepeat2`](#backgroundRepeat2) | ||
|
||
-} | ||
backgroundRepeat : | ||
Value | ||
{ repeat : Supported | ||
, repeatX : Supported | ||
, repeatY : Supported | ||
, space : Supported | ||
, round : Supported | ||
, initial : Supported | ||
, unset : Supported | ||
} | ||
-> Style | ||
backgroundRepeat (Value repeat) = | ||
AppendProperty ("background-repeat:" ++ repeat) | ||
|
||
|
||
{-| Sets [`background-repeat`](https://css-tricks.com/almanac/properties/b/background-repeat/) along the horizontal axis, then the vertical axis. | ||
|
||
backgroundRepeat2 repeat space | ||
|
||
backgroundRepeat2 space round | ||
|
||
If you only need to set one value for both, see | ||
[`backgroundRepeat`](#backgroundRepeat) instead. | ||
|
||
-} | ||
backgroundRepeat2 : | ||
Value | ||
{ repeat : Supported | ||
, space : Supported | ||
, round : Supported | ||
, initial : Supported | ||
, unset : Supported | ||
} | ||
-> Style | ||
backgroundRepeat2 (Value repeat) = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you might've missed an argument here? 😄 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. haaaaaaaaaaaaa yeah |
||
AppendProperty ("background-repeat:" ++ repeat) | ||
|
||
|
||
{-| [Repeat a background](#backgroundRepeat). | ||
-} | ||
repeat : Value { provides | repeat : Supported } | ||
repeat = | ||
Value "repeat" | ||
|
||
|
||
{-| [Repeat a background](#backgroundRepeat) side to side. | ||
-} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On these Code examples would also be great, even if they're copy/pasted from the |
||
repeatX : Value { provides | repeatX : Supported } | ||
repeatX = | ||
Value "repeat-x" | ||
|
||
|
||
{-| [Repeat a background](#backgroundRepeat) up and down. | ||
-} | ||
repeatY : Value { provides | repeatY : Supported } | ||
repeatY = | ||
Value "repeat-y" | ||
|
||
|
||
{-| [Repeat a background](#backgroundRepeat) without cutting off the edges by | ||
putting **space** between the repetitions. See the [css-tricks article on | ||
this](https://css-tricks.com/almanac/properties/b/background-repeat/) for more | ||
details. | ||
-} | ||
space : Value { provides | space : Supported } | ||
space = | ||
Value "space" | ||
|
||
|
||
{-| [Repeat a background](#backgroundRepeat) without cutting off the edges by | ||
stretching or shrinking the images slightly. See the [css-tricks article on | ||
this](https://css-tricks.com/almanac/properties/b/background-repeat/) for more | ||
details. | ||
-} | ||
round : Value { provides | round : Supported } | ||
round = | ||
Value "round" | ||
|
||
|
||
|
||
{- GRADIENTS -} | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the explanation and linking between
backgroundRepeat
andbackgroundRepeat2
! 😍