1 | /*
|
---|
2 | Definitions for utilities and helper classes.
|
---|
3 | */
|
---|
4 | $hidden-name: 'hidden' !default; // Class name for hidden elements.
|
---|
5 | $visually-hidden-name: 'visually-hidden' !default; // Class name for visually hidden elements.
|
---|
6 | $border-generic-name: 'bordered' !default; // Class name for bordered elements.
|
---|
7 | $border-generic-color: rgba(0,0,0, 0.3) !default; // Border color for bordered elements.
|
---|
8 | $border-rounded-name: 'rounded' !default; // Class name for rounded-border elements.
|
---|
9 | $border-circular-name: 'circular' !default; // Class name for circular-border elements.
|
---|
10 | $box-shadow-generic-name:'shadowed' !default; // Class name for box-shadow elements.
|
---|
11 | $box-shadow-generic: 0 4*$__1px 4*$__1px 0 rgba(0, 0, 0, 0.125), 0 2*$__1px 2*$__1px -2*$__1px rgba(0, 0, 0, 0.25) !default;
|
---|
12 | $responsive-margin-name: 'responsive-margin' !default; //Class name for responsive margin elements.
|
---|
13 | $responsive-margin-medium-breakpoint: 768px !default; // Medium screen breakpoint for responsive margin elements.
|
---|
14 | $responsive-margin-large-breakpoint: 1280px !default; // Medium screen breakpoint for responsive margin elements.
|
---|
15 | $responsive-padding-name: 'responsive-padding' !default; //Class name for responsive padding elements.
|
---|
16 | $responsive-padding-medium-breakpoint: 768px !default; // Medium screen breakpoint for responsive padding elements.
|
---|
17 | $responsive-padding-large-breakpoint: 1280px !default; // Medium screen breakpoint for responsive padding elements.
|
---|
18 | $hidden-prefix: 'hidden' !default; // Class prefix for responsive hidden elements.
|
---|
19 | $hidden-small-suffix: 'sm' !default; // Class suffix for responsive hidden elements.
|
---|
20 | $hidden-medium-breakpoint: 768px !default; // Medium screen breakpoint for responsive hidden elements.
|
---|
21 | $hidden-medium-suffix: 'md' !default; // Class suffix for responsive hidden elements.
|
---|
22 | $hidden-large-breakpoint: 1280px !default; // Medium screen breakpoint for responsive hidden elements.
|
---|
23 | $hidden-large-suffix: 'lg' !default; // Class suffix for responsive hidden elements.
|
---|
24 | $visually-hidden-prefix: 'visually-hidden' !default; // Class prefix for responsive visually hidden elements.
|
---|
25 | $visually-hidden-small-suffix: 'sm' !default; // Class suffix for responsive hidden elements.
|
---|
26 | $visually-hidden-medium-breakpoint: 768px !default; // Medium screen breakpoint for responsive visually hidden elements.
|
---|
27 | $visually-hidden-medium-suffix: 'md' !default; // Class suffix for responsive hidden elements.
|
---|
28 | $visually-hidden-large-breakpoint: 1280px !default; // Medium screen breakpoint for responsive visually hidden elements.
|
---|
29 | $visually-hidden-large-suffix: 'lg' !default; // Class suffix for responsive hidden elements.
|
---|
30 | // CSS variable name definitions [exercise caution if modifying these]
|
---|
31 | $border-generic-color-var: '--generic-border-color' !default;
|
---|
32 | $box-shadow-generic-var: '--generic-box-shadow' !default;
|
---|
33 | // == Uncomment below code if this module is used on its own ==
|
---|
34 | //
|
---|
35 | // $universal-margin: 0.5rem !default; // Universal margin for the most elements
|
---|
36 | // $universal-padding: 0.5rem !default; // Universal padding for the most elements
|
---|
37 | // $universal-border-radius: 0.125rem !default; // Universal border-radius for most elements
|
---|
38 | // $universal-box-shadow: none !default; // Universal box-shadow for most elements
|
---|
39 | // $universal-margin-var: '--universal-margin' !default;
|
---|
40 | // $universal-padding-var: '--universal-padding' !default;
|
---|
41 | // $universal-border-radius-var: '--universal-border-radius' !default;
|
---|
42 | // $universal-box-shadow-var: '--universal-box-shadow' !default;
|
---|
43 | // :root {
|
---|
44 | // #{$universal-margin-var}: $universal-margin;
|
---|
45 | // #{$universal-padding-var}: $universal-padding;
|
---|
46 | // #{$universal-border-radius-var}: $universal-border-radius;
|
---|
47 | // @if $universal-box-shadow != none {
|
---|
48 | // #{$universal-box-shadow-var}: $universal-box-shadow;
|
---|
49 | // }
|
---|
50 | // }
|
---|
51 | //
|
---|
52 | // ============================================================
|
---|
53 | /* Utility module CSS variable definitions */
|
---|
54 | :root {
|
---|
55 | #{$border-generic-color-var}: $border-generic-color;
|
---|
56 | #{$box-shadow-generic-var}: $box-shadow-generic;
|
---|
57 | }
|
---|
58 | // Hidden elements class. NOTE: Uses !important.
|
---|
59 | .#{$hidden-name}{
|
---|
60 | display: none !important;
|
---|
61 | }
|
---|
62 | // Visually hidden elements class. NOTE: Uses !important.
|
---|
63 | .#{$visually-hidden-name} {
|
---|
64 | position: absolute !important;
|
---|
65 | width: 1px !important;
|
---|
66 | height: 1px !important;
|
---|
67 | margin: -1px !important;
|
---|
68 | border: 0 !important;
|
---|
69 | padding: 0 !important;
|
---|
70 | clip: rect(0 0 0 0) !important;
|
---|
71 | -webkit-clip-path: inset(100%) !important;
|
---|
72 | clip-path: inset(100%) !important;
|
---|
73 | overflow: hidden !important;
|
---|
74 | }
|
---|
75 | // Generic bordered element class. NOTE: Uses !important.
|
---|
76 | .#{$border-generic-name} {
|
---|
77 | border: $__1px solid var(#{$border-generic-color-var}) !important;
|
---|
78 | }
|
---|
79 | // Generic rounded-border element class. NOTE: Uses !important.
|
---|
80 | .#{$border-rounded-name} {
|
---|
81 | border-radius: var(#{$universal-border-radius-var}) !important;
|
---|
82 | }
|
---|
83 | // Generic circular-border element class. NOTE: Uses !important.
|
---|
84 | .#{$border-circular-name} {
|
---|
85 | border-radius: 50% !important;
|
---|
86 | }
|
---|
87 | // Generic box-shadow element class. NOTE: Uses !important.
|
---|
88 | .#{$box-shadow-generic-name} {
|
---|
89 | box-shadow: var(#{$box-shadow-generic-var}) !important;
|
---|
90 | }
|
---|
91 | // Responsive margin class. NOTE: Uses !important.
|
---|
92 | .#{$responsive-margin-name} {
|
---|
93 | margin: calc(var(#{$universal-margin-var}) / 4) !important;
|
---|
94 | @media screen and (min-width: #{$responsive-margin-medium-breakpoint}) {
|
---|
95 | margin: calc(var(#{$universal-margin-var}) / 2) !important;
|
---|
96 | }
|
---|
97 | @media screen and (min-width: #{$responsive-margin-large-breakpoint}) {
|
---|
98 | margin: var(#{$universal-margin-var}) !important;
|
---|
99 | }
|
---|
100 | }
|
---|
101 | // Responsive padding class. NOTE: Uses !important.
|
---|
102 | .#{$responsive-padding-name} {
|
---|
103 | padding: calc(var(#{$universal-padding-var}) / 4) !important;
|
---|
104 | @media screen and (min-width: #{$responsive-padding-medium-breakpoint}) {
|
---|
105 | padding: calc(var(#{$universal-padding-var}) / 2) !important;
|
---|
106 | }
|
---|
107 | @media screen and (min-width: #{$responsive-padding-large-breakpoint}) {
|
---|
108 | padding: var(#{$universal-padding-var}) !important;
|
---|
109 | }
|
---|
110 | }
|
---|
111 | // Responsive hidden element class. NOTE: Uses !important.
|
---|
112 | @media screen and (max-width: $hidden-medium-breakpoint - 1px) {
|
---|
113 | .#{$hidden-prefix}-#{$hidden-small-suffix} {
|
---|
114 | display: none !important;
|
---|
115 | }
|
---|
116 | }
|
---|
117 | @media screen and (min-width: #{$hidden-medium-breakpoint}) and (max-width: $hidden-large-breakpoint - 1px) {
|
---|
118 | .#{$hidden-prefix}-#{$hidden-medium-suffix} {
|
---|
119 | display: none !important;
|
---|
120 | }
|
---|
121 | }
|
---|
122 | @media screen and (min-width: #{$hidden-large-breakpoint}) {
|
---|
123 | .#{$hidden-prefix}-#{$hidden-large-suffix} {
|
---|
124 | display: none !important;
|
---|
125 | }
|
---|
126 | }
|
---|
127 | // Responsive visually hidden element class. NOTE: Uses !important.
|
---|
128 | @media screen and (max-width: $visually-hidden-medium-breakpoint - 1px) {
|
---|
129 | .#{$visually-hidden-prefix}-#{$visually-hidden-small-suffix} {
|
---|
130 | position: absolute !important;
|
---|
131 | width: 1px !important;
|
---|
132 | height: 1px !important;
|
---|
133 | margin: -1px !important;
|
---|
134 | border: 0 !important;
|
---|
135 | padding: 0 !important;
|
---|
136 | clip: rect(0 0 0 0) !important;
|
---|
137 | -webkit-clip-path: inset(100%) !important;
|
---|
138 | clip-path: inset(100%) !important;
|
---|
139 | overflow: hidden !important;
|
---|
140 | }
|
---|
141 | }
|
---|
142 | @media screen and (min-width: #{$visually-hidden-medium-breakpoint}) and (max-width: $visually-hidden-large-breakpoint - 1px) {
|
---|
143 | .#{$visually-hidden-prefix}-#{$visually-hidden-medium-suffix} {
|
---|
144 | position: absolute !important;
|
---|
145 | width: 1px !important;
|
---|
146 | height: 1px !important;
|
---|
147 | margin: -1px !important;
|
---|
148 | border: 0 !important;
|
---|
149 | padding: 0 !important;
|
---|
150 | clip: rect(0 0 0 0) !important;
|
---|
151 | -webkit-clip-path: inset(100%) !important;
|
---|
152 | clip-path: inset(100%) !important;
|
---|
153 | overflow: hidden !important;
|
---|
154 | }
|
---|
155 | }
|
---|
156 | @media screen and (min-width: #{$visually-hidden-large-breakpoint}) {
|
---|
157 | .#{$visually-hidden-prefix}-#{$visually-hidden-large-suffix} {
|
---|
158 | position: absolute !important;
|
---|
159 | width: 1px !important;
|
---|
160 | height: 1px !important;
|
---|
161 | margin: -1px !important;
|
---|
162 | border: 0 !important;
|
---|
163 | padding: 0 !important;
|
---|
164 | clip: rect(0 0 0 0) !important;
|
---|
165 | -webkit-clip-path: inset(100%) !important;
|
---|
166 | clip-path: inset(100%) !important;
|
---|
167 | overflow: hidden !important;
|
---|
168 | }
|
---|
169 | }
|
---|