forked from canonical/vanilla-framework
/
_base_placeholders.scss
161 lines (132 loc) · 3.84 KB
/
_base_placeholders.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
@import 'settings';
@import 'base_typography-definitions';
// Placeholders containing used rules in multiple base components and patterns
// Default settings can be found in _settings_placeholders
@mixin vf-b-placeholders {
@include vf-b-typography-definitions;
// Styling
%vf-has-round-corners {
border-radius: $border-radius;
}
%vf-has-box-shadow {
box-shadow: $box-shadow;
}
%vf-is-bordered {
border: $border;
}
%vf-bg--light {
background-color: $color-light;
color: $color-dark;
}
%vf-bg--x-light {
background-color: $color-x-light;
color: $color-dark;
}
%vf-card {
@extend %vf-bg--x-light;
margin-bottom: $spv-outer--scaleable;
overflow: auto; // prevent overflow of child margins
padding: $spv-inner--large;
}
//accordion, table
%single-border-text-vpadding--scaling {
padding-bottom: $table-cell-vertical-padding;
padding-top: calc(#{$table-cell-vertical-padding} - 1px);
}
// Default list styling
%vf-list {
list-style: none;
margin-left: 0;
padding-left: 0;
}
// Bars and borders
%vf-pseudo-border {
background-color: $color-mid-light;
content: '';
height: 1px;
left: 0;
position: absolute;
right: 0;
}
%vf-pseudo-border--bottom {
position: relative;
&::after {
@extend %vf-pseudo-border;
bottom: 0;
}
}
%vf-pseudo-border--top {
position: relative;
&::after {
@extend %vf-pseudo-border;
top: 0;
}
}
// Utilities
%vf-hide-text {
overflow: hidden;
// rem value necessary because text indent in % does not work with padding;
// 10rem is larger than any padding value on an element you'd hide text in (buttons, icons)
// but still smaller than 9999px so should have better performance
text-indent: calc(100% + 10rem);
white-space: nowrap;
}
%vf-clearfix::after {
clear: both;
content: '';
display: block;
}
%u-no-margin--bottom {
&:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(p):not(small):not([class*='p-heading']) {
margin-bottom: 0 !important;
}
}
%u-no-margin--bottom--h1 {
@media (max-width: $breakpoint-heading-threshold) {
margin-bottom: -#{map-get($nudges, nudge--h1-mobile)} !important;
}
@media (min-width: $breakpoint-heading-threshold) {
margin-bottom: -#{map-get($nudges, nudge--h1)} !important;
}
@if ($increase-font-size-on-larger-screens) {
@media (min-width: $breakpoint-x-large) {
margin-bottom: -#{map-get($nudges, nudge--h1-large)} !important;
}
}
}
%u-no-margin--bottom--h2 {
@media (max-width: $breakpoint-heading-threshold) {
margin-bottom: -#{map-get($nudges, nudge--h2-mobile)} !important;
}
@media (min-width: $breakpoint-heading-threshold) {
margin-bottom: -#{map-get($nudges, nudge--h2)} !important;
}
}
%u-no-margin--bottom--h3 {
@media (max-width: $breakpoint-heading-threshold) {
margin-bottom: #{$sp-unit - map-get($nudges, nudge--h3-mobile)} !important;
}
@media (min-width: $breakpoint-heading-threshold) {
margin-bottom: -#{map-get($nudges, nudge--h3)} !important;
}
}
%u-no-margin--bottom--h4 {
@media (max-width: $breakpoint-heading-threshold) {
margin-bottom: #{$sp-unit - map-get($nudges, nudge--h4-mobile)} !important;
}
@media (min-width: $breakpoint-heading-threshold) {
margin-bottom: -#{map-get($nudges, nudge--h4)} !important;
}
@if ($increase-font-size-on-larger-screens) {
@media (min-width: $breakpoint-x-large) {
margin-bottom: -#{map-get($nudges, nudge--h4-large)} !important;
}
}
}
%u-no-margin--bottom--default-text {
margin-bottom: #{$sp-unit - map-get($nudges, nudge--p)} !important;
}
%u-no-margin--bottom--small {
margin-bottom: -#{map-get($nudges, nudge--small)} !important;
}
}