Skip to content

Commit

Permalink
Helpers & utilities split
Browse files Browse the repository at this point in the history
  • Loading branch information
MartijnCuppens committed Apr 24, 2019
1 parent 275cd7f commit 840526b
Show file tree
Hide file tree
Showing 40 changed files with 908 additions and 458 deletions.
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -165,11 +165,11 @@
"bundlesize": [
{
"path": "./dist/css/bootstrap-grid.css",
"maxSize": "7 kB"
"maxSize": "8 kB"
},
{
"path": "./dist/css/bootstrap-grid.min.css",
"maxSize": "6 kB"
"maxSize": "7.2 kB"
},
{
"path": "./dist/css/bootstrap-reboot.css",
Expand Down
24 changes: 24 additions & 0 deletions scss/_functions.scss
Expand Up @@ -30,6 +30,30 @@
}
}

// Internal Bootstrap function to turn maps into its negative variant.
// If prefixes the keys with `n` and makes the value negative.
@function negativify-map($map) {
$result: ();
@each $key, $value in $map {
@if $key != 0 {
$result: map-merge($result, ("n" + $key: (-$value)));
}
}
@return $result;
}

// Get multiple keys from a sass map
@function map-get-multiple($map, $values) {
$result: ();
@each $key, $value in $map {
@if (index($values, $key) != null) {
$result: map-merge($result, ($key: $value));
}
}
@return $map;
}


// Replace `$search` with `$replace` in `$string`
// Used on our SVG icon backgrounds for custom forms.
//
Expand Down
7 changes: 7 additions & 0 deletions scss/_helpers.scss
@@ -0,0 +1,7 @@
@import "helpers/background";
@import "helpers/clearfix";
@import "helpers/embed";
@import "helpers/position";
@import "helpers/screenreaders";
@import "helpers/stretched-link";
@import "helpers/text";
5 changes: 4 additions & 1 deletion scss/_mixins.scss
Expand Up @@ -8,7 +8,7 @@
// Deprecate
@import "mixins/deprecate";

// Utilities
// Helpers
@import "mixins/breakpoints";
@import "mixins/hover";
@import "mixins/image";
Expand All @@ -18,6 +18,9 @@
@import "mixins/text-emphasis";
@import "mixins/text-truncate";

// Utilities
@import "mixins/utilities";

// Components
@import "mixins/alert";
@import "mixins/buttons";
Expand Down

0 comments on commit 840526b

Please sign in to comment.