2013-02-05 14:16:51 -05:00
|
|
|
// --------------------------------------------------
|
|
|
|
// Variables used throughout the theme
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
2014-02-10 01:04:21 -05:00
|
|
|
// Layout dimensions
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
2014-07-09 19:56:35 -04:00
|
|
|
$small-width: 800px !default;
|
2014-02-10 01:04:21 -05:00
|
|
|
$medium-width: 995px !default;
|
|
|
|
$large-width: 1110px !default;
|
|
|
|
|
2019-02-06 11:37:18 -05:00
|
|
|
$topic-body-width: 690px;
|
|
|
|
$topic-body-width-padding: 11px;
|
|
|
|
$topic-avatar-width: 45px;
|
2020-09-10 13:29:14 -04:00
|
|
|
$reply-area-max-width: 1475px !default;
|
2018-04-19 11:36:09 -04:00
|
|
|
|
2022-10-25 14:45:37 -04:00
|
|
|
:root {
|
|
|
|
--topic-body-width: #{$topic-body-width};
|
|
|
|
--topic-body-width-padding: #{$topic-body-width-padding};
|
|
|
|
--topic-avatar-width: #{$topic-avatar-width};
|
2022-11-16 11:35:09 -05:00
|
|
|
--d-border-radius: initial;
|
|
|
|
--d-nav-pill-border-radius: var(--d-border-radius);
|
|
|
|
--d-button-border-radius: var(--d-border-radius);
|
|
|
|
--d-input-border-radius: var(--d-border-radius);
|
2022-10-25 14:45:37 -04:00
|
|
|
}
|
|
|
|
|
2022-07-19 22:56:41 -04:00
|
|
|
$d-sidebar-width: 16em !default;
|
|
|
|
|
2014-05-06 23:53:04 -04:00
|
|
|
// Brand color variables
|
2014-02-10 01:04:21 -05:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
2018-10-24 22:11:19 -04:00
|
|
|
$google: #ffffff !default;
|
2020-07-28 18:21:53 -04:00
|
|
|
$google-hover: darken($google, 5%) !default;
|
2019-03-15 17:20:52 -04:00
|
|
|
$instagram: #e1306c !default;
|
2020-07-28 18:21:53 -04:00
|
|
|
$instagram-hover: darken($instagram, 15%) !default;
|
2021-02-10 15:53:18 -05:00
|
|
|
$facebook: #1877f2 !default;
|
2020-07-28 18:21:53 -04:00
|
|
|
$facebook-hover: darken($facebook, 15%) !default;
|
2018-06-08 05:49:31 -04:00
|
|
|
$cas: #70ba61 !default;
|
2019-03-15 17:20:52 -04:00
|
|
|
$twitter: #1da1f2 !default;
|
2020-07-28 18:21:53 -04:00
|
|
|
$twitter-hover: darken($twitter, 10%) !default;
|
2019-03-15 17:20:52 -04:00
|
|
|
$github: #100e0f !default;
|
2020-07-28 18:21:53 -04:00
|
|
|
$github-hover: lighten($github, 20%) !default;
|
2019-08-30 05:54:19 -04:00
|
|
|
$discord: #7289da !default;
|
2020-07-28 18:21:53 -04:00
|
|
|
$discord-hover: darken($discord, 10%) !default;
|
2014-02-10 01:04:21 -05:00
|
|
|
|
2018-05-23 16:55:57 -04:00
|
|
|
// Badge color variables
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
$gold: rgb(231, 195, 0) !default;
|
|
|
|
$silver: #c0c0c0 !default;
|
|
|
|
$bronze: #cd7f32 !default;
|
|
|
|
|
2014-03-26 21:16:41 -04:00
|
|
|
// Fonts
|
2013-02-05 14:16:51 -05:00
|
|
|
// --------------------------------------------------
|
|
|
|
|
2020-08-31 06:14:09 -04:00
|
|
|
$base-font-family: var(--font-family) !default;
|
2021-04-28 20:21:59 -04:00
|
|
|
$base-font-size-smallest: var(--base-font-size-smallest) !default;
|
|
|
|
$base-font-size-smaller: var(--base-font-size-smaller) !default;
|
|
|
|
$base-font-size: var(--base-font-size) !default;
|
|
|
|
$base-font-size-larger: var(--base-font-size-larger) !default;
|
|
|
|
$base-font-size-largest: var(--base-font-size-largest) !default;
|
2020-10-05 13:40:41 -04:00
|
|
|
$heading-font-family: var(--heading-font-family) !default;
|
2013-02-05 14:16:51 -05:00
|
|
|
|
2021-05-20 21:43:47 -04:00
|
|
|
// Font-size definitions, multiplier ^ (step / interval)
|
2021-04-28 20:21:59 -04:00
|
|
|
$font-up-6: var(--font-up-6) !default;
|
|
|
|
$font-up-5: var(--font-up-5) !default;
|
|
|
|
$font-up-4: var(--font-up-4) !default;
|
|
|
|
$font-up-3: var(--font-up-3) !default;
|
|
|
|
$font-up-2: var(--font-up-2) !default;
|
|
|
|
$font-up-1: var(--font-up-1) !default;
|
|
|
|
$font-0: var(--font-0);
|
|
|
|
$font-down-1: var(--font-down-1) !default;
|
|
|
|
$font-down-2: var(--font-down-2) !default;
|
|
|
|
$font-down-3: var(--font-down-3) !default;
|
|
|
|
$font-down-4: var(--font-down-4) !default;
|
|
|
|
$font-down-5: var(--font-down-5) !default;
|
|
|
|
$font-down-6: var(--font-down-6) !default;
|
|
|
|
|
2018-01-12 17:27:38 -05:00
|
|
|
// Common line-heights
|
2021-04-28 20:21:59 -04:00
|
|
|
$line-height-small: var(--line-height-small) !default;
|
|
|
|
$line-height-medium: var(--line-height-medium) !default;
|
|
|
|
$line-height-large: var(--line-height-large) !default;
|
2018-01-12 17:27:38 -05:00
|
|
|
|
2015-08-20 16:10:54 -04:00
|
|
|
@import "common/foundation/math";
|
2014-05-19 01:17:59 -04:00
|
|
|
|
2018-01-16 19:05:12 -05:00
|
|
|
// Z-index
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
$z-layers: (
|
2018-06-08 05:49:31 -04:00
|
|
|
"max": 9999,
|
2018-01-16 19:05:12 -05:00
|
|
|
"modal": (
|
2022-09-27 14:47:13 -04:00
|
|
|
"dialog": 1700,
|
2018-06-08 05:49:31 -04:00
|
|
|
"tooltip": 1600,
|
|
|
|
"popover": 1500,
|
|
|
|
"dropdown": 1400,
|
|
|
|
"content": 1300,
|
|
|
|
"overlay": 1200,
|
2018-01-16 19:05:12 -05:00
|
|
|
),
|
2018-06-13 20:56:14 -04:00
|
|
|
"fullscreen": 1150,
|
2018-06-08 05:49:31 -04:00
|
|
|
"mobile-composer": 1100,
|
2019-04-15 15:25:40 -04:00
|
|
|
"ipad-header-nav": 1020,
|
2018-06-08 05:49:31 -04:00
|
|
|
"header": 1000,
|
2019-04-15 12:03:42 -04:00
|
|
|
"footer-nav": 900,
|
2018-06-08 05:49:31 -04:00
|
|
|
"tooltip": 600,
|
2018-01-16 19:05:12 -05:00
|
|
|
"composer": (
|
2018-06-08 05:49:31 -04:00
|
|
|
"dropdown": 700,
|
|
|
|
"tooltip": 600,
|
|
|
|
"popover": 500,
|
|
|
|
"content": 400,
|
2018-01-16 19:05:12 -05:00
|
|
|
),
|
2018-06-08 05:49:31 -04:00
|
|
|
"dropdown": 300,
|
|
|
|
"usercard": 200,
|
|
|
|
"timeline": 100,
|
|
|
|
"base": 1,
|
|
|
|
);
|
2018-01-16 19:05:12 -05:00
|
|
|
|
|
|
|
@function map-has-nested-keys($map, $keys...) {
|
|
|
|
@each $key in $keys {
|
|
|
|
@if not map-has-key($map, $key) {
|
|
|
|
@return false;
|
|
|
|
}
|
|
|
|
$map: map-get($map, $key);
|
|
|
|
}
|
|
|
|
@return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@function map-deep-get($map, $keys...) {
|
|
|
|
@each $key in $keys {
|
|
|
|
$map: map-get($map, $key);
|
|
|
|
}
|
|
|
|
@return $map;
|
|
|
|
}
|
|
|
|
|
|
|
|
@function z($layers...) {
|
|
|
|
@if not map-has-nested-keys($z-layers, $layers...) {
|
|
|
|
@warn "No layer defined for `#{inspect($layers...)}` in $z-layers map. Check variables.scss, property omitted.";
|
|
|
|
}
|
|
|
|
@return map-deep-get($z-layers, $layers...);
|
|
|
|
}
|
|
|
|
|
2018-02-20 12:18:20 -05:00
|
|
|
// Box-shadow
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
|
|
|
$box-shadow: (
|
2018-06-08 05:49:31 -04:00
|
|
|
"modal": 0 8px 60px rgba(0, 0, 0, 0.6),
|
|
|
|
"composer": 0 -1px 40px rgba(0, 0, 0, 0.12),
|
2019-03-28 15:13:53 -04:00
|
|
|
"menu-panel": 0 12px 12px rgba(0, 0, 0, 0.15),
|
2018-06-08 05:49:31 -04:00
|
|
|
"card": 0 4px 14px rgba(0, 0, 0, 0.15),
|
|
|
|
"dropdown": 0 2px 3px 0 rgba(0, 0, 0, 0.2),
|
|
|
|
"header": 0 2px 4px -1px rgba(0, 0, 0, 0.25),
|
2019-04-12 12:29:54 -04:00
|
|
|
"footer-nav": 0 0 2px 0 rgba(0, 0, 0, 0.25),
|
2018-06-08 05:49:31 -04:00
|
|
|
"kbd": (
|
|
|
|
0 2px 0 rgba(0, 0, 0, 0.2),
|
|
|
|
0 0 0 1px dark-light-choose(#fff, #000) inset,
|
|
|
|
),
|
2021-02-03 11:45:54 -05:00
|
|
|
"focus": 0 0 3px 0 $tertiary,
|
2018-02-20 12:18:20 -05:00
|
|
|
"focus-danger": 0 0 6px 0 $danger,
|
|
|
|
);
|
|
|
|
|
|
|
|
@function shadow($key) {
|
|
|
|
@return map-get($box-shadow, $key);
|
|
|
|
}
|
|
|
|
|
2018-01-12 17:27:38 -05:00
|
|
|
// Color utilities
|
|
|
|
// --------------------------------------------------
|
2015-08-20 15:54:07 -04:00
|
|
|
|
2017-08-25 14:09:00 -04:00
|
|
|
// w3c definition of color brightness https://www.w3.org/TR/AERT#color-contrast
|
|
|
|
@function dc-color-brightness($color) {
|
2018-06-08 05:49:31 -04:00
|
|
|
@return (
|
|
|
|
(red($color) * 0.299) + (green($color) * 0.587) + (blue($color) * 0.114)
|
|
|
|
);
|
2014-08-06 09:31:13 -04:00
|
|
|
}
|
|
|
|
|
2015-08-20 15:54:07 -04:00
|
|
|
// Uses an approximation of sRGB blending, GAMMA=2 instead of GAMMA=2.2
|
2015-08-20 16:31:00 -04:00
|
|
|
@function srgb-scale($foreground, $background, $percent) {
|
2015-08-20 15:54:07 -04:00
|
|
|
$ratio: ($percent / 100%);
|
|
|
|
$iratio: 1 - $ratio;
|
2015-08-20 16:31:00 -04:00
|
|
|
$f_r2: red($foreground) * red($foreground);
|
|
|
|
$f_g2: green($foreground) * green($foreground);
|
|
|
|
$f_b2: blue($foreground) * blue($foreground);
|
|
|
|
$b_r2: red($background) * red($background);
|
|
|
|
$b_g2: green($background) * green($background);
|
|
|
|
$b_b2: blue($background) * blue($background);
|
|
|
|
$r_r2: $f_r2 * $ratio + $b_r2 * $iratio;
|
|
|
|
$r_g2: $f_g2 * $ratio + $b_g2 * $iratio;
|
|
|
|
$r_b2: $f_b2 * $ratio + $b_b2 * $iratio;
|
|
|
|
$r_r: sqrt($r_r2);
|
|
|
|
$r_g: sqrt($r_g2);
|
|
|
|
$r_b: sqrt($r_b2);
|
|
|
|
@return rgb($r_r, $r_g, $r_b);
|
|
|
|
}
|
|
|
|
|
2022-02-17 15:39:29 -05:00
|
|
|
// Replaces dark-light-diff($primary,50%)
|
|
|
|
@function blend-two-colors($color1, $color2, $percent) {
|
|
|
|
@return srgb-scale($color1, $color2, $percent);
|
2015-08-20 16:31:00 -04:00
|
|
|
}
|
|
|
|
|
2020-12-16 09:38:51 -05:00
|
|
|
@function blend-header-primary-background($percent) {
|
|
|
|
@return srgb-scale($header_primary, $header_background, $percent);
|
|
|
|
}
|
|
|
|
|
2018-06-08 05:49:31 -04:00
|
|
|
@function dark-light-diff(
|
|
|
|
$adjusted-color,
|
|
|
|
$comparison-color,
|
|
|
|
$lightness,
|
|
|
|
$darkness
|
|
|
|
) {
|
|
|
|
@if dc-color-brightness($adjusted-color) <
|
|
|
|
dc-color-brightness($comparison-color)
|
|
|
|
{
|
2015-04-23 13:33:29 -04:00
|
|
|
@return scale-color($adjusted-color, $lightness: $lightness);
|
2014-08-06 09:31:13 -04:00
|
|
|
} @else {
|
2015-04-23 13:33:29 -04:00
|
|
|
@return scale-color($adjusted-color, $lightness: $darkness);
|
2014-08-06 09:31:13 -04:00
|
|
|
}
|
|
|
|
}
|
2015-08-18 15:23:06 -04:00
|
|
|
@function dark-light-choose($light-theme-result, $dark-theme-result) {
|
2019-11-26 09:06:30 -05:00
|
|
|
@if is-light-color-scheme() {
|
2015-08-18 15:23:06 -04:00
|
|
|
@return $light-theme-result;
|
|
|
|
} @else {
|
|
|
|
@return $dark-theme-result;
|
|
|
|
}
|
|
|
|
}
|
2017-06-11 22:20:14 -04:00
|
|
|
|
2019-11-26 09:06:30 -05:00
|
|
|
@function is-light-color-scheme() {
|
|
|
|
@if dc-color-brightness($primary) < dc-color-brightness($secondary) {
|
|
|
|
@return true;
|
|
|
|
} @else {
|
|
|
|
@return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@function is-dark-color-scheme() {
|
|
|
|
@return not is-light-color-scheme();
|
|
|
|
}
|
|
|
|
|
2019-08-12 06:02:38 -04:00
|
|
|
@import "color_transformations";
|