selfprivacy.org/_vendor/github.com/google/docsy/assets/scss/_boxes.scss

119 lines
2.4 KiB
SCSS
Raw Normal View History

2024-04-25 22:15:39 +00:00
// Boxes on the home page and similar: .td-box
2024-04-21 23:04:16 +00:00
2024-04-25 22:15:39 +00:00
// box-variant creates the main style for a colored section
2024-04-21 23:04:16 +00:00
@mixin box-variant($parent, $color-name, $color-value) {
2024-04-25 22:15:39 +00:00
$text-color: color-contrast($color-value);
$link-color: mix($blue, $text-color, lightness($color-value));
$link-hover-color: if(
color-contrast($link-color) == $color-contrast-light,
shade-color($link-color, $link-shade-percentage),
tint-color($link-color, $link-shade-percentage)
);
#{$parent} {
&--#{$color-name} {
color: $text-color;
background-color: #{$color-value};
.td-arrow-down {
&::before {
left: 50%;
margin-left: -30px;
bottom: -25px;
border: {
style: solid;
width: 25px 30px 0 30px;
color: #{$color-value} transparent transparent transparent;
}
z-index: 3;
position: absolute;
content: "";
2024-04-21 23:04:16 +00:00
}
2024-04-25 22:15:39 +00:00
}
2024-04-21 23:04:16 +00:00
}
2024-04-25 22:15:39 +00:00
}
2024-04-21 23:04:16 +00:00
2024-04-25 22:15:39 +00:00
// Improve contrast for the links in paragraphs.
@include link-variant(
"#{$parent}--#{$color-name} p > a, #{$parent}--#{$color-name} span > a",
$link-color,
$link-hover-color,
false
);
2024-04-21 23:04:16 +00:00
}
// Common min-height modifiers used for boxes.
@mixin td-box-height-modifiers($parent) {
2024-04-25 22:15:39 +00:00
#{$parent} {
&--height-min {
min-height: 300px;
}
2024-04-21 23:04:16 +00:00
2024-04-25 22:15:39 +00:00
&--height-med {
min-height: 400px;
}
2024-04-21 23:04:16 +00:00
2024-04-25 22:15:39 +00:00
&--height-max {
min-height: 500px;
}
2024-04-21 23:04:16 +00:00
2024-04-25 22:15:39 +00:00
&--height-full {
min-height: 100vh;
}
2024-04-21 23:04:16 +00:00
2024-04-25 22:15:39 +00:00
@include media-breakpoint-up(md) {
&--height-min {
min-height: 450px;
}
2024-04-21 23:04:16 +00:00
2024-04-25 22:15:39 +00:00
&--height-med {
min-height: 500px;
}
2024-04-21 23:04:16 +00:00
2024-04-25 22:15:39 +00:00
&--height-max {
min-height: 650px;
}
2024-04-21 23:04:16 +00:00
}
2024-04-25 22:15:39 +00:00
}
2024-04-21 23:04:16 +00:00
}
@include td-box-height-modifiers(".td-box");
// Styling for section boxes
.td-box {
.row {
2024-04-25 22:15:39 +00:00
padding-left: 5vw;
padding-right: 5vw;
}
table {
@extend .td-table;
2024-04-21 23:04:16 +00:00
}
}
2024-04-25 22:15:39 +00:00
2024-04-21 23:04:16 +00:00
// Styling for community page link boxes
.td-box.linkbox {
2024-04-25 22:15:39 +00:00
padding: 5vh 5vw;
2024-04-21 23:04:16 +00:00
}
// This allows "painting by numbers"
@for $i from 1 through length($td-box-colors) {
2024-04-25 22:15:39 +00:00
$c: nth($td-box-colors, $i);
$name: $i - 1;
2024-04-21 23:04:16 +00:00
2024-04-25 22:15:39 +00:00
@include box-variant(".td-box", $name, $c);
2024-04-21 23:04:16 +00:00
}
// Same as above with all the theme color names.
@each $color, $value in $colors {
2024-04-25 22:15:39 +00:00
@include box-variant(".td-box", $color, $value);
2024-04-21 23:04:16 +00:00
}
@each $color, $value in $theme-colors {
2024-04-25 22:15:39 +00:00
@include box-variant(".td-box", $color, $value);
2024-04-21 23:04:16 +00:00
}
@each $color, $value in $grays {
2024-04-25 22:15:39 +00:00
@include box-variant(".td-box", $color, $value);
2024-04-21 23:04:16 +00:00
}