diff options
author | Martijn Cuppens <martijn.cuppens@gmail.com> | 2019-08-28 19:05:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-28 19:05:56 +0300 |
commit | 89f7a63ee4826b646ec659709cc170b8c45cddbc (patch) | |
tree | aab7f3991699ffe9f423a0599b9e1c75442e6d4d /test/stylus | |
parent | 7a15c1a4e41b1fd46b3f26be3529abc1e2d65a4d (diff) |
Support for every property (#144)
- Support for all properties
- Shorthand mixins for margins and paddings
- Support for custom properties
- Clearer way to declare `!important` rules: `@include rfs(1rem !important)` instead of `@include rfs(1rem, true)`
- Switched to mobile first approach, still possible to switch to the `max-width` media queries if needed
- Configuration variables are changed:
- Base font size -> Base value
- Font size unit -> Unit
- `responsive-font-size` property changed to `rfs()` function (see https://github.com/twbs/rfs/issues/116)
- Dropped `responsive-font-size` mixins
- Dropped Less 2 support since we had to work with lists
- Prevent generation of `/test/expected/main.css`
- Additional tests for new implementations
- Cleanup npm scripts examples
- Code examples in `README.md` are grouped by processor and collapsed
Diffstat (limited to 'test/stylus')
-rw-r--r-- | test/stylus/main.styl | 71 | ||||
-rw-r--r-- | test/stylus/test-10.styl | 4 | ||||
-rw-r--r-- | test/stylus/test-11.styl | 2 | ||||
-rw-r--r-- | test/stylus/test-2.styl | 2 | ||||
-rw-r--r-- | test/stylus/test-6.styl | 2 | ||||
-rw-r--r-- | test/stylus/test-7.styl | 2 | ||||
-rw-r--r-- | test/stylus/test-9.styl | 4 |
7 files changed, 73 insertions, 14 deletions
diff --git a/test/stylus/main.styl b/test/stylus/main.styl index 644bd9a..22f2f17 100644 --- a/test/stylus/main.styl +++ b/test/stylus/main.styl @@ -3,29 +3,86 @@ .selector-1 background-color: #f00 width: 300px - responsive-font-size(32px) + rfs(32px) .selector-2 - responsive-font-size(2rem) + rfs(2rem) .selector-3 - responsive-font-size(2rem, true) + rfs(2rem !important) .selector-4 rfs(2rem) .selector-5 - responsive-font-size(2em) + rfs(2em) .selector-6 - responsive-font-size(inherit) + rfs(inherit) @supports (display: flex) .selector-7 rfs(28px) .selector-8 - responsive-font-size(32) + rfs(0 999 32rem, flex) .selector-9 - responsive-font-size(2rem) + rfs(2rem, padding) + +.selector-10 + rfs-padding(2rem) + +.selector-11 + rfs-padding-top(2rem) + +.selector-12 + rfs-padding-right(2rem) + +.selector-13 + rfs-padding-bottom(2rem) + +.selector-14 + rfs-padding-left(2rem) + +.selector-15 + rfs-margin(2rem) + +.selector-16 + rfs-margin-top(2rem) + +.selector-17 + rfs-margin-right(2rem) + +.selector-18 + rfs-margin-bottom(2rem) + +.selector-19 + rfs-margin-left(2rem) + +.selector-20 + rfs-margin(2rem 3rem) + +.selector-21 + rfs-margin(2rem 3rem !important) + +.selector-22 + rfs(0) + +.selector-23 + rfs-margin(0 3rem) + +.selector-24 + rfs(0 0 2rem #f00\, 0 0 3rem #0f0, box-shadow) + +.selector-25 + rfs(3rem, --value) + +.selector-26 + rfs-font-size(10px) + +.selector-27 + rfs-margin(-3rem) + +.selector-28 + rfs-margin(-.5rem) diff --git a/test/stylus/test-10.styl b/test/stylus/test-10.styl index 695140f..1797f01 100644 --- a/test/stylus/test-10.styl +++ b/test/stylus/test-10.styl @@ -1,5 +1,5 @@ -$rfs-base-font-size = 12px -$rfs-font-size-unit = px +$rfs-base-value = 12px +$rfs-unit = px $rfs-breakpoint = 800 $rfs-breakpoint-unit = rem $rfs-two-dimensional = true diff --git a/test/stylus/test-11.styl b/test/stylus/test-11.styl new file mode 100644 index 0000000..03c0fd2 --- /dev/null +++ b/test/stylus/test-11.styl @@ -0,0 +1,2 @@ +$rfs-mode = "max-media-query" +@import "main" diff --git a/test/stylus/test-2.styl b/test/stylus/test-2.styl index 1ecdedc..3fba4fe 100644 --- a/test/stylus/test-2.styl +++ b/test/stylus/test-2.styl @@ -1,2 +1,2 @@ -$enable-responsive-font-sizes = false +$enable-rfs = false @import "main"; diff --git a/test/stylus/test-6.styl b/test/stylus/test-6.styl index f3df4b1..476d8d5 100644 --- a/test/stylus/test-6.styl +++ b/test/stylus/test-6.styl @@ -1,2 +1,2 @@ -$rfs-base-font-size = 17px +$rfs-base-value = 17px @import "main"; diff --git a/test/stylus/test-7.styl b/test/stylus/test-7.styl index fce5ecd..070bad8 100644 --- a/test/stylus/test-7.styl +++ b/test/stylus/test-7.styl @@ -1,2 +1,2 @@ -$rfs-font-size-unit = px +$rfs-unit = px @import "main"; diff --git a/test/stylus/test-9.styl b/test/stylus/test-9.styl index a860640..e37acb9 100644 --- a/test/stylus/test-9.styl +++ b/test/stylus/test-9.styl @@ -1,5 +1,5 @@ -$rfs-base-font-size = 12px -$rfs-font-size-unit = px +$rfs-base-value = 12px +$rfs-unit = px $rfs-breakpoint = 800 $rfs-breakpoint-unit = rem $rfs-two-dimensional = true |