hedgedoc/global-styles/colors-only-bootstrap/_alert.scss
Tilman Vatteroth ca25760d48 feat: vendor special version of bootstrap 5
The vendored version contains ONLY the color rules. This makes it easy to create custom themes on top of the original bootstrap.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2022-11-11 23:43:30 +01:00

22 lines
864 B
SCSS

/*!
* SPDX-FileCopyrightText: Original code: Copyright (c) 2011-2022 Twitter, Inc. + Copyright (c) 2011-2022 The Bootstrap Authors. Modification: 2022 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: MIT
*/
// scss-docs-start alert-modifiers
// Generate contextual modifier classes for colorizing the alert.
@each $state, $value in $theme-colors {
$alert-background: shift-color($value, $alert-bg-scale);
$alert-border: shift-color($value, $alert-border-scale);
$alert-color: shift-color($value, $alert-color-scale);
@if (contrast-ratio($alert-background, $alert-color) < $min-contrast-ratio) {
$alert-color: mix($value, color-contrast($alert-background), abs($alert-color-scale));
}
.alert-#{$state} {
@include alert-variant($alert-background, $alert-border, $alert-color);
}
}
// scss-docs-end alert-modifiers