Skip to content

Commit 1010f6b

Browse files
committed
cleanup, prevent lightningcss color-mix() to lab() conversion, remove more
1 parent 935b48c commit 1010f6b

10 files changed

Lines changed: 23 additions & 90 deletions

File tree

.bundlewatch.config.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,39 @@
22
"files": [
33
{
44
"path": "./dist/css/bootstrap-grid.css",
5-
"maxSize": "9.25 kB"
5+
"maxSize": "8.75 kB"
66
},
77
{
88
"path": "./dist/css/bootstrap-grid.min.css",
9-
"maxSize": "10.0 kB"
9+
"maxSize": "8.0 kB"
1010
},
1111
{
1212
"path": "./dist/css/bootstrap-reboot.css",
1313
"maxSize": "5.25 kB"
1414
},
1515
{
1616
"path": "./dist/css/bootstrap-reboot.min.css",
17-
"maxSize": "6.5 kB"
17+
"maxSize": "5.0 kB"
1818
},
1919
{
2020
"path": "./dist/css/bootstrap-utilities.css",
21-
"maxSize": "14.5 kB"
21+
"maxSize": "15.75 kB"
2222
},
2323
{
2424
"path": "./dist/css/bootstrap-utilities.min.css",
25-
"maxSize": "15.25 kB"
25+
"maxSize": "15.0 kB"
2626
},
2727
{
2828
"path": "./dist/css/bootstrap.css",
29-
"maxSize": "41.25 kB"
29+
"maxSize": "42.5 kB"
3030
},
3131
{
3232
"path": "./dist/css/bootstrap.min.css",
33-
"maxSize": "39.75 kB"
33+
"maxSize": "39.25 kB"
3434
},
3535
{
3636
"path": "./dist/js/bootstrap.bundle.js",
37-
"maxSize": "70.5 kB"
37+
"maxSize": "70.0 kB"
3838
},
3939
{
4040
"path": "./dist/js/bootstrap.bundle.min.js",

scss/_colors.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ $colors: defaults(
5757

5858
// scss-docs-start color-mix-options
5959
$color-mix-space: lab !default;
60-
$tint-color: $white !default;
61-
$shade-color: $black !default;
60+
$tint-color: var(--white) !default;
61+
$shade-color: var(--black) !default;
6262

6363
$color-tints: (
6464
"025": 94%,

scss/_functions.scss

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -41,53 +41,6 @@
4141
}
4242
}
4343

44-
// Colors
45-
@function to-rgb($value) {
46-
@return color.channel($value, "red"), color.channel($value, "green"), color.channel($value, "blue");
47-
}
48-
49-
// stylelint-disable scss/dollar-variable-pattern
50-
@function rgba-css-var($identifier, $target) {
51-
@if $identifier == "body" and $target == "bg" {
52-
@return rgba(var(--#{$identifier}-bg-rgb), var(--#{$target}-opacity));
53-
} @if $identifier == "body" and $target == "text" {
54-
@return rgba(var(--#{$identifier}-color-rgb), var(--#{$target}-opacity));
55-
} @else {
56-
@return rgba(var(--#{$identifier}-rgb), var(--#{$target}-opacity));
57-
}
58-
}
59-
60-
@function map-loop($map, $func, $args...) {
61-
$_map: ();
62-
63-
@each $key, $value in $map {
64-
// allow to pass the $key and $value of the map as an function argument
65-
$_args: ();
66-
@each $arg in $args {
67-
$resolved-arg: $arg;
68-
@if $arg == "$key" {
69-
$resolved-arg: $key;
70-
} @else if $arg == "$value" {
71-
$resolved-arg: $value;
72-
}
73-
$_args: list.append($_args, $resolved-arg);
74-
}
75-
76-
$_map: map.merge($_map, ($key: meta.call(meta.get-function($func), $_args...)));
77-
}
78-
79-
@return $_map;
80-
}
81-
// stylelint-enable scss/dollar-variable-pattern
82-
83-
@function varify($list) {
84-
$result: null;
85-
@each $entry in $list {
86-
$result: list.append($result, var(--#{$entry}), space);
87-
}
88-
@return $result;
89-
}
90-
9144
// Internal Bootstrap function to turn maps into its negative variant.
9245
// It prefixes the keys with `n` and makes the value negative.
9346
@function negativify-map($map) {
@@ -253,20 +206,3 @@ $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003
253206
@function opaque($background, $foreground) {
254207
@return color-mix(in srgb, rgba($foreground, 1), $background, color.opacity($foreground) * 100%);
255208
}
256-
257-
// scss-docs-start color-functions
258-
// // Tint a color: mix a color with white
259-
@function tint-color($color, $weight) {
260-
@return color.mix(white, $color, $weight);
261-
}
262-
263-
// // Shade a color: mix a color with black
264-
@function shade-color($color, $weight) {
265-
@return color.mix(black, $color, $weight);
266-
}
267-
268-
// // Shade the color if the weight is positive, else tint it
269-
@function shift-color($color, $weight) {
270-
@return if(sass($weight > 0): shade-color($color, $weight); else: tint-color($color, -$weight));
271-
}
272-
// scss-docs-end color-functions

scss/_variables.scss

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@use "colors" as *;
21
@use "config" as *;
32
@use "functions" as *;
43

@@ -21,7 +20,7 @@ $escaped-characters: (
2120
// The gradient which is added to components if `$enable-gradients` is `true`
2221
// This gradient is also added to elements with `.bg-gradient`
2322
// scss-docs-start variable-gradient
24-
$gradient: linear-gradient(180deg, rgba($white, .15), rgba($white, 0)) !default;
23+
$gradient: linear-gradient(180deg, color-mix(var(--white) 15%, transparent), color-mix(var(--white) 0%, transparent)) !default;
2524
// scss-docs-end variable-gradient
2625

2726
// Spacing
@@ -67,9 +66,6 @@ $position-values: (
6766
// $link-color: var !default;
6867
$link-decoration: underline !default;
6968
$link-underline-offset: .2em !default;
70-
$link-shade-percentage: 20% !default;
71-
// $link-hover-color: shift-color($link-color, $link-shade-percentage) !default;
72-
// $link-hover-decoration: $link-decoration !default;
7369

7470
$stretched-link-pseudo-element: after !default;
7571
$stretched-link-z-index: 1 !default;

scss/content/_reboot.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ $reboot-mark-tokens: defaults(
238238

239239
small,
240240
.small {
241-
font-size: var(--small-font-size, var(--font-size-sm));
241+
font-size: var(--small-font-size, 87.5%);
242242
}
243243

244244
// Mark

site/src/content/docs/components/navbar.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,6 @@ To make a navbar dark, add `data-bs-theme="dark"` to the `.navbar` element.
372372
</div>
373373
</nav>`} />
374374

375-
376375
## Color schemes
377376

378377
Navbar themes are easier than ever thanks to Bootstrap's combination of Sass and CSS variables. The default is our "light navbar" for use with light background colors, but you can also apply `data-bs-theme="dark"` to the `.navbar` parent for dark background colors. Then, customize with `.bg-*` and additional utilities.

site/src/content/docs/customize/color.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const additionalColors = [
1616

1717
There are 13 shades of 16 colors in Bootstrap's new color system, meaning we have 208 colors to work with when using Bootstrap.
1818

19-
All Bootstrap colors are available as Sass variables and a Sass map in `scss/_variables.scss` file. To avoid increased file sizes, we don’t create text or background color classes for each of these variables. Instead, we choose a subset of these colors for a [theme palette](#theme-colors).
19+
All Bootstrap colors are available as Sass variables and a Sass map in `scss/_variables.scss` file. To avoid increased file sizes, we don’t create text or background color classes for each of these variables. Instead, we choose a subset of these colors for a [theme palette]([[docsref:/customize/theme]]).
2020

2121
Be sure to monitor contrast ratios as you customize colors. As shown below, we’ve added three contrast ratios to each of the main colors—one for the swatch’s current colors, one for against white, and one for against black.
2222

site/src/content/docs/customize/sass.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,10 +386,6 @@ Base colors are defined as `oklch()` values and expanded into full scales via `c
386386

387387
You can reference any color scale step as a CSS custom property: `var(--blue-500)`, `var(--red-200)`, `var(--gray-900)`, etc.
388388

389-
Bootstrap also includes `tint-color()`, `shade-color()`, and `shift-color()` Sass functions for mixing colors with white or black:
390-
391-
<ScssDocs name="color-functions" file="scss/_functions.scss" />
392-
393389
### Color contrast
394390

395391
In order to meet the [Web Content Accessibility Guidelines (WCAG)](https://www.w3.org/TR/WCAG/) contrast requirements, authors **must** provide a minimum [text color contrast of 4.5:1](https://www.w3.org/TR/WCAG/#contrast-minimum) and a minimum [non-text color contrast of 3:1](https://www.w3.org/TR/WCAG/#non-text-contrast), with very few exceptions.

site/src/content/docs/customize/theme.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ And within each semantic theme color, you'll find the following keys, most of wh
7979

8080
Every token is available as a CSS variable, and most are then consumed by our utilities and components. So for the `primary` color, you have the following colors:
8181

82-
<div class="grid gap-0" style={{gridTemplateColumns: 'repeat(9, 1fr)', gap: '8px', minWidth: '0'}}>
82+
<div class="grid bd-theme-colors-grid small">
8383
{getData('theme-colors').map((color) => {
8484
return (
8585
<div class="d-contents grid-cols-fill">

site/src/scss/_component-examples.scss

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,12 +399,18 @@
399399
gap: 4px;
400400
min-width: 0;
401401

402-
@include media-breakpoint-up(md) {
403-
// grid-template-columns: repeat(13, 1fr);
402+
@include media-breakpoint-up(xl) {
403+
grid-template-columns: repeat(13, 1fr);
404404
}
405+
}
406+
407+
.bd-theme-colors-grid {
408+
grid-template-columns: repeat(5, 1fr);
409+
gap: 8px;
410+
min-width: 0;
405411

406412
@include media-breakpoint-up(xl) {
407-
grid-template-columns: repeat(13, 1fr);
413+
grid-template-columns: repeat(9, 1fr);
408414
}
409415
}
410416
}

0 commit comments

Comments
 (0)