53b48340b3a1580e41eb4f4d468fa0ad945fe647
[ndcode_site.git] / css / bootstrap / _custom.scss
1 // Nick
2
3 $footer-link-color: darken(theme-color("success"), 10%);
4 $footer-link-hover-color: darken($footer-link-color, 10%);
5
6 // apply this to a div inside the body tag
7 // prevents page shifting to left/right as scrollbar appears/disappears
8 // it works by calculating the width of the scrollbar and then adding
9 // the corresponding amount of padding to left to keep things centered
10 // see https://stackoverflow.com/questions/45524214/how-do-i-stop-my-web-content-from-shifting-left-when-the-vertical-scrollbar-appe
11 .scrollbar-fix {
12   padding-left: calc(100vw - 100%);
13 }
14
15 // needed for svg icons inside buttons, card headers, etc
16 // creates an inline element with correct width but no height
17 // the svg is positioned within this to vertically centre on a capital letter
18 $icon-sizes: (
19   24: 24px,
20   32: 32px,
21   48: 48px,
22   64: 64px
23 );
24 @each $icon-size, $icon-size-px in $icon-sizes {
25   .icon#{$icon-size}-outer {
26     display: inline-block;
27     position: relative;
28     width: $icon-size-px;
29     height: 0;
30     vertical-align: baseline;
31   }
32   .icon#{$icon-size}-inner {
33     position: absolute;
34     left: 0px;
35     top: calc(-.5 * $icon-size-px - .35em); // .35em = approx half cap height
36     width: $icon-size-px;
37     height: $icon-size-px;
38     fill: currentColor;
39     stroke: currentColor;
40   }
41 }
42
43 // use this to display the pi symbol without horrible blocky look in Sans
44 .serif {
45   font-family: $font-family-serif;
46 }
47
48 // apply this to table to get an icon with vertically centred text next to it
49 .icon-and-text {
50   vertical-align: middle;
51   td {
52     padding: .25em .5em;
53   }
54 }
55
56 .search-results li {
57   margin-bottom: .5em;
58 }
59
60 footer, .footer {
61   padding-top: 35px;
62   padding-bottom: 25px;
63   background-color: $gray-400;
64   a {
65     color: $footer-link-color;
66
67     &:hover,
68     &:focus {
69       color: $footer-link-hover-color;
70       //background-color: $footer-link-hover-bg;
71     }
72   }
73 }