Improved scrollbar-fix-(inner|outer) classes, inner class expands content to avoid...
[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 // uses negative margin to force content to be drawn under the scrollbar
9 // (this is useful for modals since scrollbar disappears during a modal)
10 // note: intended to be used with div.container which adds padding for
11 // media sizes sm and above, don't do it for xs to avoid losing content
12 .scrollbar-fix-outer {
13   overflow-x: hidden;
14 }
15 .scrollbar-fix-inner {
16   @include media-breakpoint-up(sm) {
17     margin-right: calc(100% - 100vw);
18   }
19 }
20
21 // place a container div around entire page, and then use this
22 // to make the background on navbar or footer appear full-width
23 .extend-background {
24   margin-left: calc(-.5 * (100vw - 100%));
25   margin-right: calc(-.5 * (100vw - 100%));
26   padding-left: calc(.5 * (100vw - 100%));
27   padding-right: calc(.5 * (100vw - 100%));
28 }
29
30 // needed for svg icons inside buttons, card headers, etc
31 // creates an inline element with correct width but no height
32 // the svg is positioned within this to vertically centre on a capital letter
33 $icon-sizes: (
34   24: 24px,
35   32: 32px,
36   48: 48px,
37   64: 64px
38 );
39 @each $icon-size, $icon-size-px in $icon-sizes {
40   .icon#{$icon-size}-outer {
41     display: inline-block;
42     position: relative;
43     width: $icon-size-px;
44     height: 0;
45     vertical-align: baseline;
46   }
47   .icon#{$icon-size}-inner {
48     position: absolute;
49     left: 0px;
50     top: calc(-.5 * $icon-size-px - .35em); // .35em = approx half cap height
51     width: $icon-size-px;
52     height: $icon-size-px;
53     fill: currentColor;
54     stroke: currentColor;
55   }
56 }
57
58 // use this to display the pi symbol without horrible blocky look in Sans
59 .serif {
60   font-family: $font-family-serif;
61 }
62
63 // apply this to table to get an icon with vertically centred text next to it
64 .icon-and-text {
65   vertical-align: middle;
66   td {
67     padding: .25em .5em;
68   }
69 }
70
71 .search-results li {
72   margin-bottom: .5em;
73 }
74
75 footer, .footer {
76   padding-top: 35px;
77   padding-bottom: 25px;
78   background-color: $gray-400;
79   a {
80     color: $footer-link-color;
81
82     &:hover,
83     &:focus {
84       color: $footer-link-hover-color;
85       //background-color: $footer-link-hover-bg;
86     }
87   }
88 }