Skip to content

Commit

Permalink
Merge branch 'main' into main-fod-subtract-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Jul 8, 2021
2 parents 4d19246 + 0fc117c commit 4fffa45
Show file tree
Hide file tree
Showing 8 changed files with 234 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ restrictions:

* Please **do not** use the issue tracker for personal support requests. Stack
Overflow ([`bootstrap-5`](https://stackoverflow.com/questions/tagged/bootstrap-5) tag),
[Slack](https://bootstrap-slack.herokuapp.com/) or [IRC](README.md#community) are better places to get help.
[Slack](https://bootstrap-slack.herokuapp.com/) or [IRC](/README.md#community) are better places to get help.

* Please **do not** derail or troll issues. Keep the discussion on topic and
respect the opinions of others.
Expand Down
71 changes: 53 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@
"bundlewatch": "^0.3.2",
"clean-css-cli": "^5.3.0",
"cross-env": "^7.0.3",
"eslint": "^7.29.0",
"eslint": "^7.30.0",
"eslint-config-xo": "^0.36.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-unicorn": "^31.0.0",
"find-unused-sass-variables": "^3.1.0",
"glob": "^7.1.7",
"globby": "^11.0.4",
"hammer-simulator": "0.0.1",
"hugo-bin": "^0.72.5",
"hugo-bin": "^0.73.0",
"ip": "^1.1.5",
"jquery": "^3.6.0",
"karma": "^6.3.4",
Expand All @@ -138,10 +138,10 @@
"npm-run-all": "^4.1.5",
"postcss": "^8.3.5",
"postcss-cli": "^8.3.1",
"rollup": "^2.52.6",
"rollup": "^2.52.8",
"rollup-plugin-istanbul": "^3.0.0",
"rtlcss": "^3.2.1",
"sass": "^1.35.1",
"sass": "^1.35.2",
"shelljs": "^0.8.4",
"stylelint": "^13.13.1",
"stylelint-config-twbs-bootstrap": "^2.2.1",
Expand Down
1 change: 1 addition & 0 deletions scss/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
background-clip: border-box;
border: $card-border-width solid $card-border-color;
@include border-radius($card-border-radius);
@include box-shadow($card-box-shadow);

> hr {
margin-right: 0;
Expand Down
10 changes: 10 additions & 0 deletions scss/_functions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@
@return $result;
}

// Merge multiple maps
@function map-merge-multiple($maps...) {
$merged-maps: ();

@each $map in $maps {
$merged-maps: map-merge($merged-maps, $map);
}
@return $merged-maps;
}

// Replace `$search` with `$replace` in `$string`
// Used on our SVG icon backgrounds for custom forms.
//
Expand Down
123 changes: 122 additions & 1 deletion scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,126 @@ $cyan-600: shade-color($cyan, 20%) !default;
$cyan-700: shade-color($cyan, 40%) !default;
$cyan-800: shade-color($cyan, 60%) !default;
$cyan-900: shade-color($cyan, 80%) !default;

$blues: (
"blue-100": $blue-100,
"blue-200": $blue-200,
"blue-300": $blue-300,
"blue-400": $blue-400,
"blue-500": $blue-500,
"blue-600": $blue-600,
"blue-700": $blue-700,
"blue-800": $blue-800,
"blue-900": $blue-900
) !default;

$indigos: (
"indigo-100": $indigo-100,
"indigo-200": $indigo-200,
"indigo-300": $indigo-300,
"indigo-400": $indigo-400,
"indigo-500": $indigo-500,
"indigo-600": $indigo-600,
"indigo-700": $indigo-700,
"indigo-800": $indigo-800,
"indigo-900": $indigo-900
) !default;

$purples: (
"purple-100": $purple-200,
"purple-200": $purple-100,
"purple-300": $purple-300,
"purple-400": $purple-400,
"purple-500": $purple-500,
"purple-600": $purple-600,
"purple-700": $purple-700,
"purple-800": $purple-800,
"purple-900": $purple-900
) !default;

$pinks: (
"pink-100": $pink-100,
"pink-200": $pink-200,
"pink-300": $pink-300,
"pink-400": $pink-400,
"pink-500": $pink-500,
"pink-600": $pink-600,
"pink-700": $pink-700,
"pink-800": $pink-800,
"pink-900": $pink-900
) !default;

$reds: (
"red-100": $red-100,
"red-200": $red-200,
"red-300": $red-300,
"red-400": $red-400,
"red-500": $red-500,
"red-600": $red-600,
"red-700": $red-700,
"red-800": $red-800,
"red-900": $red-900
) !default;

$oranges: (
"orange-100": $orange-100,
"orange-200": $orange-200,
"orange-300": $orange-300,
"orange-400": $orange-400,
"orange-500": $orange-500,
"orange-600": $orange-600,
"orange-700": $orange-700,
"orange-800": $orange-800,
"orange-900": $orange-900
) !default;

$yellows: (
"yellow-100": $yellow-100,
"yellow-200": $yellow-200,
"yellow-300": $yellow-300,
"yellow-400": $yellow-400,
"yellow-500": $yellow-500,
"yellow-600": $yellow-600,
"yellow-700": $yellow-700,
"yellow-800": $yellow-800,
"yellow-900": $yellow-900
) !default;

$greens: (
"green-100": $green-100,
"green-200": $green-200,
"green-300": $green-300,
"green-400": $green-400,
"green-500": $green-500,
"green-600": $green-600,
"green-700": $green-700,
"green-800": $green-800,
"green-900": $green-900
) !default;

$teals: (
"teal-100": $teal-100,
"teal-200": $teal-200,
"teal-300": $teal-300,
"teal-400": $teal-400,
"teal-500": $teal-500,
"teal-600": $teal-600,
"teal-700": $teal-700,
"teal-800": $teal-800,
"teal-900": $teal-900
) !default;

$cyans: (
"cyan-100": $cyan-100,
"cyan-200": $cyan-200,
"cyan-300": $cyan-300,
"cyan-400": $cyan-400,
"cyan-500": $cyan-500,
"cyan-600": $cyan-600,
"cyan-700": $cyan-700,
"cyan-800": $cyan-800,
"cyan-900": $cyan-900
) !default;
// fusv-enable

// Characters which are escaped by the escape-svg function
Expand Down Expand Up @@ -1088,8 +1208,9 @@ $card-spacer-y: $spacer !default;
$card-spacer-x: $spacer !default;
$card-title-spacer-y: $spacer * .5 !default;
$card-border-width: $border-width !default;
$card-border-radius: $border-radius !default;
$card-border-color: rgba($black, .125) !default;
$card-border-radius: $border-radius !default;
$card-box-shadow: null !default;
$card-inner-border-radius: subtract($card-border-radius, $card-border-width) !default;
$card-cap-padding-y: $card-spacer-y * .5 !default;
$card-cap-padding-x: $card-spacer-x !default;
Expand Down
42 changes: 42 additions & 0 deletions site/content/docs/5.0/customize/color.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,45 @@ Here's how you can use these in your Sass:
```

[Color]({{< docsref "/utilities/colors" >}}) and [background]({{< docsref "/utilities/background" >}}) utility classes are also available for setting `color` and `background-color` using the `500` color values.

## Generating utilities

<small class="d-inline-flex px-2 py-1 font-monospace text-muted border rounded-3">Added in v5.1.0</small>

Bootstrap doesn't include `color` and `background-color` utilities for every color variable, but you can generate these yourself with our [utility API]({{< docsref "/utilities/api" >}}) and our extended Sass maps added in v5.1.0.

1. To start, make sure you've imported our functions, variables, mixins, and utilities.
2. Use our `map-merge-multiple()` function to quickly merge multiple Sass maps together in a new map.
3. Merge this new combined map to extend any utility with a `{color}-{level}` class name.

Here's an example that generates text color utilities (e.g., `.text-purple-500`) using the above steps.

```scss
@import "bootstrap/scss/functions";
@import "bootstrap/scss/variables";
@import "bootstrap/scss/mixins";
@import "bootstrap/scss/utilities";

$all-colors: map-merge-multiple($blues, $indigos, $purples, $pinks, $reds, $oranges, $yellows, $greens, $teals, $cyans);

$utilities: map-merge(
$utilities,
(
"color": map-merge(
map-get($utilities, "color"),
(
values: map-merge(
map-get(map-get($utilities, "color"), "values"),
(
$all-colors
),
),
),
),
)
);

@import "bootstrap/scss/utilities/api";
```

This will generate new `.text-{color}-{level}` utilities for every color and level. You can do the same for any other utility and property as well.
2 changes: 1 addition & 1 deletion site/layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h5>Links</h5>
<li class="mb-2"><a href="/">Home</a></li>
<li class="mb-2"><a href="/docs/{{ .Site.Params.docs_version }}/">Docs</a></li>
<li class="mb-2"><a href="/docs/{{ .Site.Params.docs_version }}/examples/">Examples</a></li>
<li class="mb-2"><a href="{{ .Site.Params.opencollective }}">Themes</a></li>
<li class="mb-2"><a href="{{ .Site.Params.themes }}">Themes</a></li>
<li class="mb-2"><a href="{{ .Site.Params.blog }}">Blog</a></li>
</ul>
</div>
Expand Down

0 comments on commit 4fffa45

Please sign in to comment.