Skip to content

Commit 2de0568

Browse files
author
AMJones
committed
Moves rwd type utilities and functions to new package.
1 parent a62f198 commit 2de0568

File tree

8 files changed

+33
-228
lines changed

8 files changed

+33
-228
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"css"
1111
],
1212
"homepage": "https://www.github.com/strapless/base",
13-
"version": "1.1.9",
13+
"version": "2.0",
1414
"authors": [
1515
{
1616
"name": "Aaron M Jones",

js/afterwards.js

Lines changed: 0 additions & 33 deletions
This file was deleted.

scss/_base.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
@import "functions/getset";
77

88
// Mixins
9-
@import "mixins/media-query";
109
@import "mixins/rounding";
1110
@import "base-mixins";
1211
@import "mixins/bs4-shim";

scss/functions/_functions.scss

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,38 @@
4444
@return $string;
4545
}
4646

47+
// Explodes a string into a SASS list by the given delimiter
48+
// @author Hugo Giraudel (modified from original)
49+
@function _str-explode($string, $delimiter: "") {
50+
$result: ();
51+
$length: str-length($string);
52+
53+
@if str-length($delimiter) == 0 {
54+
@for $i from 1 through $length {
55+
$result: append($result, str-slice($string, $i, $i));
56+
}
57+
58+
@return $result;
59+
}
60+
61+
$running: true;
62+
$remaining: $string;
63+
64+
@while $running {
65+
$index: str-index($remaining, $delimiter);
66+
67+
@if $index {
68+
$slice: str-slice($remaining, 1, $index - 1);
69+
$result: append($result, $slice);
70+
$remaining: str-slice($remaining, $index + str-length($delimiter));
71+
} @else {
72+
$running: false;
73+
}
74+
}
75+
76+
@return append($result, $remaining);
77+
}
78+
4779
// Converts 1 or more characters into a unicode
4880
// @source - [@Stephn-R](https://github.com/sass/sass/issues/1395#issuecomment-57483844)
4981
@function unicode($str){
@@ -97,22 +129,3 @@
97129
}
98130

99131
// endregion //////////////////////////////////////////////////////////// End SVG String
100-
101-
// region /////////////////////////////////////////////////////////////// Other Functions
102-
103-
@function breakpoint-infix($bp) {
104-
@if variable-exists(grid-breakpoints) == false {
105-
@error 'You must set the $grid-breakpoints map prior to the first usage of the `breakpoint-infix` function.';
106-
}
107-
@if map-has-key($grid-breakpoints, $bp) {
108-
$min: strip-unit(map-get($grid-breakpoints, $bp));
109-
@if $min > 0 {
110-
@return -#{$bp};
111-
}
112-
}
113-
114-
@return null;
115-
}
116-
117-
// endregion //////////////////////////////////////////////////////////// End Other Functions
118-

scss/functions/_getset.scss

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,6 @@
33

44
// region /////////////////////////////////////////////////////////////// Getter Functions
55

6-
@function breakpoint($breakpoint) {
7-
@if map-has-key($grid-breakpoints,$breakpoint) {
8-
@return map-get($grid-breakpoints, $breakpoint);
9-
}
10-
11-
@error "The breakpoint `#{$breakpoint} does not exist in the $grid-breakpoints map.";
12-
}
13-
14-
@function container($breakpoint) {
15-
@if map-has-key($container-max-widths,$breakpoint) {
16-
@return map-get($container-max-widths, $breakpoint);
17-
}
18-
19-
@error "The breakpoint `#{$breakpoint} does not exist in the $container-max-widths map.";
20-
}
21-
226
/// Constant Getter - Credit to https://twitter.com/HugoGiraudel
237
///
248
/// @param {String} $name Name of constant to get
@@ -196,22 +180,6 @@
196180
}
197181
}
198182

199-
@mixin set-breakpoint($breakpoint,$value) {
200-
@if not(variable-exists(grid-breakpoints)) {
201-
@error "You may not use the `set-breakpoint` mixin without the $grid-breakpoints map. Please include `root-variables` prior to this usage."
202-
} @else {
203-
$grid-breakpoints: set-map-key($grid-breakpoints, $breakpoint, $value) !global;
204-
}
205-
}
206-
207-
@mixin set-max-width($breakpoint,$value) {
208-
@if not(variable-exists(grid-breakpoints)) {
209-
@error "You may not use the `set-max-width` mixin without the $container-max-widths map. Please include `root-variables` prior to this usage."
210-
} @else {
211-
$container-max-widths: set-map-key($container-max-widths, $breakpoint, $value) !global;
212-
}
213-
}
214-
215183
@mixin _set-space($size,$axis,$value) {
216184
$spacing-temp: ();
217185
@if not(variable-exists(spacing)) {

scss/mixins/_bs4-shim.scss

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
@import "media-query";
2-
3-
@mixin media-breakpoint-up($bp) {
4-
@include media("screen", ">=#{$bp}") {
5-
@content;
6-
}
7-
}
8-
9-
@mixin media-breakpoint-down($bp) {
10-
@include media("screen", "<=#{$bp}") {
11-
@content;
12-
}
13-
}
141

152
// Note: This mixin is for legacy bootstrap code that calls it. Vendor prefixes aren't needed for opacity.
163
@mixin opacity($o) {

scss/mixins/_media-query.scss

Lines changed: 0 additions & 99 deletions
This file was deleted.

scss/variables/_root-variables.scss

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -56,35 +56,6 @@ $theme: (
5656

5757
// endregion //////////////////////////////////////////////////////////// End Features
5858

59-
// region /////////////////////////////////////////////////////////////// Breakpoint & Grid
60-
61-
62-
$grid-breakpoints: (
63-
xs: 0,
64-
sm: 576px,
65-
md: 768px,
66-
lg: 992px,
67-
xl: 1200px
68-
) !default;
69-
70-
$container-max-widths: (
71-
sm: 540px,
72-
md: 720px,
73-
lg: 960px,
74-
xl: 1140px
75-
) !default;
76-
77-
$condition-map: (
78-
"screen": "screen",
79-
"print" : "print",
80-
"coarse": "(pointer: fine)",
81-
"touch" : "(pointer: coarse), (-moz-touch-enabled)",
82-
"fine" : "(pointer: fine), not all and (-moz-touch-enabled)",
83-
"hidpi" : "(-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi)"
84-
);
85-
86-
// endregion //////////////////////////////////////////////////////////// End Breakpoint & Grid
87-
8859
// region /////////////////////////////////////////////////////////////// Utility Variables
8960

9061
$utility:
@@ -93,7 +64,6 @@ $utility:
9364
md,
9465
lg,
9566
xl,
96-
touch,
9767
fallback,
9868
baseline,
9969
ios,

0 commit comments

Comments
 (0)