-
Notifications
You must be signed in to change notification settings - Fork 64
/
wysiwyg.sass
281 lines (268 loc) · 6.11 KB
/
wysiwyg.sass
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
/*! wysiwyg.css v0.0.3 | MIT License | github.com/jgthms/wysiwyg.css */
// Colours
$blue: #2478ff !default
$pink: #ff2450 !default
$purple: #9524ff !default
$grey-light: hsl(0, 0%, 50%) !default
$grey: hsl(0, 0%, 20%) !default
$grey-dark: hsl(0, 0%, 10%) !default
$background: hsl(0, 0%, 95%) !default
$border: hsl(0, 0%, 90%) !default
$text: $grey !default
$text-code: $pink !default
$text-strong: $grey-dark !default
$text-light: $grey-light !default
$text-headings: $grey-dark !default
$text-blockquote: $grey-light !default
$link: $blue !default
$link-hover: $blue !default
$link-visited: $purple !default
$background-code: $background !default
$background-ins: lime !default
$background-mark: yellow !default
$table-background: hsl(0, 0%, 100%) !default
$table-background-even: hsl(0, 0%, 98%) !default
$table-background-hover: hsl(0, 0%, 96%) !default
$table-border: $border !default
$table-thead: $grey-dark !default
// Spacing
$line-height: 1.6 !default
$margin: 1.4em !default
// Typography
$family-wysiwyg: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif !default
$family-code: "Inconsolata", "Consolas", "Monaco", monospace !default
$weight-strong: 700 !default
$weight-headings: 700 !default
// Options
$closer-lists: false !default
$custom-colors: false !default
$custom-fonts: false !default
$font-smoothing: false !default
$heading-borders: false !default
$show-underline: false !default
$table-hover: false !default
$table-striped: false !default
$visited-links: false !default
// Mixins
=cell($font-size)
font-size: #{$font-size}em
padding: (($margin / 2) / $font-size)
=heading($font-size, $with-border: false, $top-space: false)
font-size: #{$font-size}em
margin-bottom: ($margin / $font-size)
@if $top-space
margin-top: ($margin * 2 / $font-size)
@else
margin-top: ($margin / $font-size)
@if $heading-borders and $with-border
border-bottom: 1px solid $border
padding-bottom: ($margin / $font-size)
// Styles
.wysiwyg
line-height: $line-height
@if $custom-colors
color: $text
@if $custom-fonts
font-family: $family-wysiwyg
@if $font-smoothing
-moz-osx-font-smoothing: grayscale
-webkit-font-smoothing: antialiased
// Inlines
a
text-decoration: none
@if $custom-colors
color: $link
@if $visited-links
&:visited
color: $link-visited
@if $show-underline
border-bottom: 1px solid
@else
&:hover
border-bottom: 1px solid
abbr
border-bottom: 1px dotted
cursor: help
cite
font-style: italic
hr
background: $border
border: none
display: block
height: 1px
margin-bottom: $margin
margin-top: $margin
img
vertical-align: text-bottom
ins
background-color: $background-ins
text-decoration: none
mark
background-color: $background-mark
small
font-size: 0.8em
strong
font-weight: $weight-strong
@if $custom-colors
color: $text-strong
sub,
sup
font-size: 0.8em
sub
vertical-align: sub
sup
vertical-align: super
// Blocks
p, dl, ol, ul, blockquote, pre, table
margin-bottom: $margin
&:last-child
margin-bottom: 0
p
&:empty
display: none
// Headings
h1, h2, h3, h4, h5, h6
font-weight: $weight-headings
line-height: 1.2
&:first-child
margin-top: 0
@if $custom-colors
color: $text-headings
h1
+heading(2.4, true)
line-height: 1
h2
+heading(1.6, true, true)
line-height: 1.1
h3
+heading(1.3)
h4
+heading(1.2)
h5
+heading(1.1)
h6
+heading(1)
// Paragraphs
@if $closer-lists
p
& + dl,
& + ol,
& + ul
margin-top: -$margin
// Lists
dd
margin-left: $margin
ol,
ul
list-style-position: outside
margin-left: $margin
ol
list-style-type: decimal
ol
list-style-type: lower-alpha
ol
list-style-type: lower-roman
ol
list-style-type: lower-greek
ol
list-style-type: decimal
ol
list-style-type: lower-alpha
ul
list-style-type: disc
ul
list-style-type: circle
ul
list-style-type: square
ul
list-style-type: circle
ul
list-style-type: disc
ul
list-style-type: circle
// Blockquote
blockquote
border-left: 4px solid $border
padding: 0.6em 1.2em
@if $custom-colors
color: $text-blockquote
p
margin-bottom: 0
// Code
code,
kbd,
samp,
pre
-moz-osx-font-smoothing: auto
-webkit-font-smoothing: auto
background-color: $background-code
color: $text
font-size: 0.9em
@if $custom-fonts
font-family: $family-code
code,
kbd,
samp
border-radius: 3px
line-height: $line-height / 0.9
padding: 0.1em 0.4em 0.2em
vertical-align: baseline
@if $custom-colors
color: $text-code
pre
overflow: auto
padding: 1em 1.2em
code
background: none
font-size: 1em
line-height: 1em
// Figure
figure
margin-bottom: $margin * 2
text-align: center
&:first-child
margin-top: 0
&:last-child
margin-bottom: 0
figcaption
font-size: 0.8em
margin-top: $margin / 1.6
@if $custom-colors
color: $text-light
// Table
table
width: 100%
pre
white-space: pre-wrap
th,
td
+cell(1)
border: 1px solid $table-border
line-height: 1.4
thead,
tfoot
tr
@if $table-striped
background-color: $table-border
@else
background-color: $table-background-hover
th,
td
+cell(0.9)
@if $custom-colors
color: $table-thead
code
background-color: $table-background
tbody
tr
background-color: $table-background
@if $table-striped
&:nth-child(even)
background-color: $table-background-even
@if $table-hover
&:hover
background-color: $table-background-hover
@else
@if $table-hover
&:hover
background-color: $table-background-even