gnosis-css/css/scss/base.scss

172 lines
4.5 KiB
SCSS
Raw Normal View History

2024-06-18 09:16:18 +02:00
@use "sass:math";
2024-05-28 13:11:00 +02:00
@import '../node_modules/bootstrap/scss/functions';
// override variables
@import './bootstrap/variables';
@import '../node_modules/bootstrap/scss/variables';
@import '../node_modules/bootstrap/scss/variables-dark';
// override maps
@import './bootstrap/maps';
@import '../node_modules/bootstrap/scss/maps';
@import '../node_modules/bootstrap/scss/mixins';
@import '../node_modules/bootstrap/scss/root';
@import '../node_modules/bootstrap/scss/utilities';
@import '../node_modules/bootstrap/scss/reboot';
// override typography
@import './bootstrap/typography';
@import './bootstrap/accordion';
2024-06-12 19:31:18 +02:00
@import './bootstrap/nav';
@import './bootstrap/navbar';
@import './bootstrap/g-components/sidebar';
@import '../node_modules/bootstrap/scss/root';
@import '../node_modules/bootstrap/scss/reboot';
@import '../node_modules/bootstrap/scss/type';
@import '../node_modules/bootstrap/scss/images';
2024-05-28 13:11:00 +02:00
@import '../node_modules/bootstrap/scss/containers';
2024-06-12 19:31:18 +02:00
@import '../node_modules/bootstrap/scss/grid';
@import '../node_modules/bootstrap/scss/tables';
@import '../node_modules/bootstrap/scss/forms';
2024-05-28 13:11:00 +02:00
@import '../node_modules/bootstrap/scss/buttons';
2024-06-12 19:31:18 +02:00
@import '../node_modules/bootstrap/scss/transitions';
@import '../node_modules/bootstrap/scss/dropdown';
@import '../node_modules/bootstrap/scss/button-group';
@import '../node_modules/bootstrap/scss/card';
@import '../node_modules/bootstrap/scss/accordion';
@import '../node_modules/bootstrap/scss/breadcrumb';
@import '../node_modules/bootstrap/scss/pagination';
@import '../node_modules/bootstrap/scss/badge';
@import '../node_modules/bootstrap/scss/alert';
@import '../node_modules/bootstrap/scss/progress';
@import '../node_modules/bootstrap/scss/list-group';
@import '../node_modules/bootstrap/scss/close';
@import '../node_modules/bootstrap/scss/toasts';
@import '../node_modules/bootstrap/scss/modal';
@import '../node_modules/bootstrap/scss/tooltip';
@import '../node_modules/bootstrap/scss/popover';
@import '../node_modules/bootstrap/scss/carousel';
@import '../node_modules/bootstrap/scss/spinners';
@import '../node_modules/bootstrap/scss/offcanvas';
@import '../node_modules/bootstrap/scss/placeholders';
2024-05-28 13:11:00 +02:00
@import './bootstrap/utilities';
@function contrast-ratio($color1, $color2) {
$luminance1: luminance($color1);
$luminance2: luminance($color2);
2024-06-18 09:16:18 +02:00
@return if(
2024-05-28 13:11:00 +02:00
$luminance1 > $luminance2,
2024-06-18 09:16:18 +02:00
math.div($luminance1 + 0.05,$luminance2 + 0.05),
math.div($luminance2 + 0.05,$luminance1 + 0.05),
2024-05-28 13:11:00 +02:00
);
}
2024-06-18 09:16:18 +02:00
@function get-contrasting-text-color(
$background-color,
$light: #fff9e5,
$dark: #33322e,
$min-contrast-ratio: 4.5
) {
2024-05-28 13:11:00 +02:00
$light-contrast: contrast-ratio($light, $background-color);
$dark-contrast: contrast-ratio($dark, $background-color);
2024-06-18 09:16:18 +02:00
@if ($dark-contrast >= $min-contrast-ratio) {
2024-05-28 13:11:00 +02:00
@return $dark;
2024-06-18 09:16:18 +02:00
} @else if ($light-contrast >= $min-contrast-ratio) {
2024-05-28 13:11:00 +02:00
@return $light;
} @else {
2024-06-18 09:16:18 +02:00
@return if($light-contrast < $dark-contrast, #000000, #ffffff);
2024-05-28 13:11:00 +02:00
}
}
@each $color, $hex in $all-colors {
.bg-#{$color} {
background-color: $hex;
color: get-contrasting-text-color($hex);
}
2024-06-12 19:31:18 +02:00
.bg-gradient-x-#{$color} {
--#{$prefix}gradient-start: 0%;
--#{$prefix}gradient-end: 100%;
--#{$prefix}gradient-to: transparent;
@include gradient-x(
$start-color: $hex,
$end-color: var(--#{$prefix}gradient-to),
$start-percent: var(--#{$prefix}gradient-start),
$end-percent: var(--#{$prefix}gradient-end)
);
}
.bg-gradient-y-#{$color} {
--#{$prefix}gradient-start: 0%;
--#{$prefix}gradient-end: 100%;
2024-05-28 13:11:00 +02:00
--#{$prefix}gradient-to: transparent;
2024-06-12 19:31:18 +02:00
@include gradient-y(
$start-color: $hex,
$end-color: var(--#{$prefix}gradient-to),
$start-percent: var(--#{$prefix}gradient-start),
$end-percent: var(--#{$prefix}gradient-end)
);
2024-05-28 13:11:00 +02:00
}
}
@each $color, $hex in $theme-colors {
.bg-gradient-#{$color} {
2024-06-12 19:31:18 +02:00
--#{$prefix}gradient-start: 0%;
--#{$prefix}gradient-end: 100%;
2024-05-28 13:11:00 +02:00
--#{$prefix}gradient-to: transparent;
2024-06-12 19:31:18 +02:00
@include gradient-x(
$start-color: $hex,
$end-color: var(--#{$prefix}gradient-to),
$start-percent: var(--#{$prefix}gradient-start),
$end-percent: var(--#{$prefix}gradient-end)
);
2024-05-28 13:11:00 +02:00
}
}
@each $color, $hex in $all-colors {
.border-#{$color} {
--#{$prefix}border-color: #{$hex};
}
}
@import '../node_modules/bootstrap/scss/utilities/api';
* {
box-sizing: border-box;
scroll-behavior: smooth;
}
2024-06-12 19:31:18 +02:00
i {
font-size: 1.5rem;
}
2024-05-28 13:11:00 +02:00
html,
body {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
2024-06-12 19:31:18 +02:00
gap: 0;
2024-05-28 13:11:00 +02:00
}
2024-06-12 19:31:18 +02:00
a {
text-decoration-thickness: 2px;
2024-06-18 09:16:18 +02:00
}
@media (min-width: 992px) {
.toc-margin {
max-width: 70%;
margin-left: 0;
}
}