-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_object.block.scss
More file actions
188 lines (120 loc) · 4.8 KB
/
Copy path_object.block.scss
File metadata and controls
188 lines (120 loc) · 4.8 KB
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
// =============================================================================
//
// Name: Block
//
// Description: Stacks an image on top of some text-like content.
//
// Block: `o-block`
//
// Elements: `o-block__img`
// `o-block__body`
//
// Modifiers: `o-block--flush`
// `o-block--tiny
// `o-block--small`
// `o-block--large`
// `o-block--huge`
// `o-block--center`
// `o-block--right`
//
// Markup:
//
// <div class="o-block">
// <img class="o-block__img" src="/path/to/image.png" alt="" />
// <div class="o-block__body">
// <p>Text-like content goes here.</p>
// </div>
// </div>
//
// =============================================================================
// Variables
// =============================================================================
// Predefine the variables bellow in order to alter and enable specific
// features.
$tree-block-namespace: $tree-namespace !default;
$tree-block-gutter: $tree-base-spacing-unit !default;
$tree-block-gutter--tiny: quarter($tree-block-gutter) !default;
$tree-block-gutter--small: halve($tree-block-gutter) !default;
$tree-block-gutter--large: double($tree-block-gutter) !default;
$tree-block-gutter--huge: quadruple($tree-block-gutter) !default;
$tree-enable-block--flush: false !default;
$tree-enable-block--tiny: false !default;
$tree-enable-block--small: false !default;
$tree-enable-block--large: false !default;
$tree-enable-block--huge: false !default;
$tree-enable-block--center: false !default;
$tree-enable-block--right: false !default;
// =============================================================================
// Block: `o-block`
// =============================================================================
.#{$tree-block-namespace}o-block {
display: block;
}
// Element: `o-block__img`
// =========================================================================
// 1. Eliminate whitespace around images.
.#{$tree-block-namespace}o-block__img {
vertical-align: middle; // [1]
margin-bottom: $tree-block-gutter;
@if ($tree-enable-block--flush == true) {
// Modifier: `o-block--flush`
// =================================================================
// No space between the image and the text content.
.#{$tree-block-namespace}o-block--flush > & {
margin-bottom: 0;
}
}
@if ($tree-enable-block--tiny == true) {
// Modifier: `o-block--tiny`
// =================================================================
// Tiny space between the image and the text content.
.#{$tree-block-namespace}o-block--tiny > & {
margin-bottom: $tree-block-gutter--tiny;
}
}
@if ($tree-enable-block--small == true) {
// Modifier: `o-block--small`
// =================================================================
// Small space between the image and the text content.
.#{$tree-block-namespace}o-block--small > & {
margin-bottom: $tree-block-gutter--small;
}
}
@if ($tree-enable-block--large == true) {
// Modifier: `o-block--large`
// =================================================================
// Large space between the image and the text content.
.#{$tree-block-namespace}o-block--large > & {
margin-bottom: $tree-block-gutter--large;
}
}
@if ($tree-enable-block--huge == true) {
// Modifier: `o-block--huge`
// =================================================================
// Huge space between the image and the text content.
.#{$tree-block-namespace}o-block--huge > & {
margin-bottom: $tree-block-gutter--huge;
}
}
}
// Element: `o-block__body`
// =========================================================================
.#{$tree-block-namespace}o-block__body {
display: block;
}
@if ($tree-enable-block--right == true) {
// Modifier: `o-block--right`
// =========================================================================
// Right-aligned blocks.
.#{$tree-block-namespace}o-block--right {
text-align: right;
}
}
@if ($tree-enable-block--center == true) {
// Modifier: `o-block--center`
// =========================================================================
// Center-aligned blocks.
.#{$tree-block-namespace}o-block--center {
text-align: center;
}
}