-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ (scss, docs, demo) adds Responsive Properties feature, v1.0.1
- Loading branch information
1 parent
f5a627a
commit 6a28e8c
Showing
19 changed files
with
179 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// In your project, write | ||
// @use '~@evanshunt/derekstrap'; | ||
@use '../../index' as derekstrap; | ||
|
||
#responsive-properties { | ||
|
||
$colors: ( | ||
'base': (darkred, mistyrose), | ||
'phone-large': (chocolate, papayawhip), | ||
'tablet': (darkgoldenrod, ivory), | ||
'desktop': (green, mintcream), | ||
'desktop-large': (navy, aliceblue), | ||
'desktop-extra-large': (purple, lavenderblush), | ||
); | ||
|
||
@include derekstrap.responsive-properties(('color', 'background-color'), $colors); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
@use "sass:math"; | ||
|
||
//@todo: document arguments | ||
@function proportional-text($font-size, $viewport-size) { | ||
@return math.div($font-size*100, $viewport-size)+vw; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@forward "mixins"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
@use '../breakpoints/index' as *; | ||
@use 'sass:meta'; | ||
@use 'sass:list'; | ||
|
||
|
||
// Allows assigning values at multiple breakpoints to any arbitrary css property | ||
/// | ||
/// @param {string | list} $properties | ||
/// Css property, or list of css properties | ||
/// @param {map} $sizes | ||
/// A breakpoint map with the values of the given proprety assigned to a list of | ||
/// breakpoints w/in the master breakpoint list. The "base" breakpoint is assigned | ||
/// without a media query. If the properties value is a list, the value assigned | ||
/// to each breakpoint should be a list the exact lengths as the properties, with | ||
/// corresponding values | ||
|
||
@mixin responsive-properties($properties, $sizes) { | ||
|
||
@if meta.type-of($properties) == 'list' { | ||
@for $i from 1 through list.length($properties) { | ||
$property: list.nth($properties, $i ); | ||
|
||
@each $breakpoint, $values in $sizes { | ||
@if list.length($values) != list.length($properties) { | ||
@error "List for breakpoint #{breakpoint} does not have the same number of items as the properties list."; | ||
} | ||
|
||
@if $breakpoint == 'base' { | ||
#{$property}: list.nth($values, $i); | ||
} @else { | ||
@include breakpoint($breakpoint) { | ||
#{$property}: list.nth($values, $i); | ||
} | ||
} | ||
} | ||
} | ||
|
||
} @else { | ||
@each $breakpoint, $value in $sizes { | ||
@if $breakpoint == 'base' { | ||
#{$properties}: $value; | ||
} @else { | ||
@include breakpoint($breakpoint) { | ||
#{$properties}: $value; | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,4 +39,7 @@ module.exports = { | |
} | ||
] | ||
}, | ||
stats: { | ||
loggingDebug: ["sass-loader"], | ||
}, | ||
}; |