Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: scss/_content.scss

Issue 29361647: Issue 4607 - Default content styles (Closed)
Left Patch Set: Added container & simplified html/scss Created Nov. 10, 2016, 1:22 p.m.
Right Patch Set: Removed extra list items and changed image text capitilization Created Nov. 17, 2016, 4:17 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
1 /*! 1 /*!
2 * This file is part of universal-design-language 2 * This file is part of universal-design-language
3 * Copyright (C) 2016 Eyeo GmbH 3 * Copyright (C) 2016 Eyeo GmbH
4 * 4 *
5 * universal-design-language is free software: you can redistribute it and/or 5 * universal-design-language is free software: you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as published by 6 * modify it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or 7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version. 8 * (at your option) any later version.
9 * 9 *
10 * universal-design-language is distributed in the hope that it will be useful, 10 * universal-design-language is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU General Public License
16 * along with web.starter-kit. If not, see <http://www.gnu.org/licenses/>. 16 * along with web.starter-kit. If not, see <http://www.gnu.org/licenses/>.
17 */ 17 */
18 18
19 /** UDL content styles */ 19 /* UDL content styles
20
21 /*!
22 * This file contains parts of:
23 * - normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css
saroyanm 2016/11/10 16:30:44 I thought we were planing to move parts of normali
juliandoucette 2016/11/10 17:42:07 We split parts of normalize.css into _reset.scss a
24 */
25
26 /* Table of contents
27 ******************************************************************************* 20 *******************************************************************************
28 * - Document 21 * - Global
29 * - Headings 22 * - Headings
30 * - Block elements 23 * - Body content
31 * - Blockquotes
32 * - Code blocks
33 * - Lists
34 * - Unstyled lists
35 * - Embeds
36 * - Inline elements
37 * - Links
38 * - Images
39 * - Alignment 24 * - Alignment
40 ******************************************************************************/ 25 ******************************************************************************/
41 26
42 /* Document 27 /* Global
juliandoucette 2016/11/22 00:54:04 @Manvel can you also acknowledge and review the re
saroyanm 2016/11/24 13:26:51 I've noticed that the ticket is out of sync, ex. w
saroyanm 2016/11/24 15:18:42 Acknowledged. We will move forward and add more c
juliandoucette 2016/11/25 16:28:43 Done.
43 ******************************************************************************/ 28 ******************************************************************************/
44 29
45 html 30 html
46 { 31 {
47 font-family: $sans-font; 32 font-family: $primary-font;
48 font-size: $medium-font; 33 font-size: $medium-font;
49 line-height: 1.15; 34 line-height: 1.15;
saroyanm 2016/11/10 16:30:43 Detail: please specify units where possible.
juliandoucette 2016/11/10 17:42:07 Acknowledged.
juliandoucette 2016/11/11 16:27:10 MDN prefers unit-less numbers for line-height valu
juliandoucette 2016/11/22 00:54:02 Note: I think I should set the primary foreground
saroyanm 2016/11/24 13:26:52 Agree.
juliandoucette 2016/11/25 16:28:42 Done.
50 } 35 }
51 36
52 /** 37 /**
53 * A centered, responsive, fixed-width container with small padding 38 * Center content within a (responsive) fixed width
54 */ 39 */
55 .container, 40 .container
juliandoucette 2016/11/22 00:54:04 I'm considering moving this to _reset.scss and ren
saroyanm 2016/11/24 13:26:50 I think we might need in future separate file for
saroyanm 2016/11/24 15:18:44 Acknowledged. We will leave here only "markdown"
juliandoucette 2016/11/25 16:28:41 Done.
56 /** 41 {
57 * A full-width container with small padding 42 width: $mobile-width;
saroyanm 2016/11/10 16:30:43 The way the comments are written are affecting CSS
juliandoucette 2016/11/10 17:42:08 Acknowledged.
juliandoucette 2016/11/11 16:27:11 Done. - I removed these comments (I don't think w
58 */
59 .container-fluid
60 {
61 width: 540px;
saroyanm 2016/11/10 16:30:45 I thought the plan was to calculate the width from
juliandoucette 2016/11/10 17:42:07 No. There is no algorithm to calculate these width
juliandoucette 2016/11/11 16:27:14 I have included ${device}-${width} variables in _v
62 max-width: 100%; 43 max-width: 100%;
63 margin: 0px auto; 44 margin: 0px auto;
64 padding: 0px $small-space; 45 padding: 0px $small-space;
65 } 46 }
66 47
67 .container:after,
saroyanm 2016/11/10 16:30:44 I do not think that this rules belong to current r
juliandoucette 2016/11/10 17:42:09 I think you are wrong. These styles clear containe
juliandoucette 2016/11/11 16:27:14 Done. I separated these classes and added more ex
68 .container-fluid:after,
69 /**
70 * Force any element to clear all
71 */
72 .float:after
juliandoucette 2016/11/10 16:08:07 This is a mistake. ".float" should be ".clearfix".
juliandoucette 2016/11/11 16:27:13 Done.
73 {
74 display: block;
75 clear: both;
76 content: "";
77 }
78
79 @media(min-width: $tablet-breakpoint) 48 @media(min-width: $tablet-breakpoint)
saroyanm 2016/11/10 16:30:46 Note: I do see a reason why @media queries are loc
juliandoucette 2016/11/10 17:42:08 Don't you think that the rules that are applied to
juliandoucette 2016/11/11 16:27:14 Done. Looks like you and Thomas outnumber me on t
saroyanm 2016/11/21 18:44:39 I thought we decided to move this rules to the bot
juliandoucette 2016/11/22 00:54:04 Acknowledged. I shouldn't have moved this back.
juliandoucette 2016/11/25 16:28:43 Done.
80 { 49 {
81 .container 50 .container
82 { 51 {
83 width: 720px; 52 width: $tablet-width;
saroyanm 2016/11/21 18:44:40 What about calculating container width according t
juliandoucette 2016/11/22 00:54:03 No. I said before that: - The breakpoints are e
saroyanm 2016/11/24 13:26:50 I was suggestion something like -> "$tablet-breakp
saroyanm 2016/11/24 15:18:43 Acknowledged. We will keep variables and not calc
juliandoucette 2016/11/25 16:28:42 Done.
84 } 53 }
85 } 54 }
86 55
87 @media(min-width: $desktop-breakpoint) 56 @media(min-width: $desktop-breakpoint)
88 { 57 {
89 .container 58 .container
90 { 59 {
91 width: 960px; 60 width: $desktop-width;
92 } 61 }
93 } 62 }
94 63
95 h1,
96 h2,
97 h3,
98 h4,
99 h5,
100 h6,
101 p, 64 p,
102 ol, 65 ol,
103 ul, 66 ul,
104 dl, 67 dl,
105 pre, 68 pre,
106 blockquote 69 blockquote
107 { 70 {
108 /* Set consistent margins (opinionated) */ 71 /* Set consistent margins (opinionated) */
109 margin: $small-space 0px; 72 margin: $small-space 0px;
110 } 73 }
111 74
112 /* Headings 75 /* Headings
113 ******************************************************************************/ 76 ******************************************************************************/
114 77
115 h1, 78 h1,
saroyanm 2016/11/10 16:30:46 Maybe it's a personal opinion, but I kinda feel li
juliandoucette 2016/11/10 17:42:06 Acknowledged.
juliandoucette 2016/11/11 16:27:12 Done.
116 h2, 79 h2,
117 h3, 80 h3,
118 h4, 81 h4,
119 h5, 82 h5,
120 h6 83 h6
121 { 84 {
122 margin-top: $medium-space; 85 margin: $medium-space 0 $small-space 0;
123 } 86 }
124 87
125 h1, 88 h1
89 {
90 font-size: round($large-font * 1.6);
saroyanm 2016/11/21 18:44:36 I would avoid using SASS methods(like round) until
saroyanm 2016/11/21 18:44:40 Thought: I think you already mentioned that and I
juliandoucette 2016/11/22 00:54:03 The idea here was to base the larger font sizes on
saroyanm 2016/11/24 13:26:49 What about having the floating pixel values ? Anyw
saroyanm 2016/11/24 15:18:43 Acknowledged. We will use Ems for everything conte
juliandoucette 2016/11/25 16:28:44 Done. Except for line-height because of https://d
91 }
92
126 h2 93 h2
127 { 94 {
128 font-weight: $thin-weight; 95 font-size: round($large-font * 1.4);
129 }
130
131 h1
132 {
133 font-size: 48px;
134 }
135
136 h2
137 {
138 font-size: 36px;
139 } 96 }
140 97
141 h3 98 h3
142 { 99 {
143 font-size: 24px; 100 font-size: round($large-font * 1.2);
144 } 101 }
145 102
146 h4 103 h4
147 { 104 {
148 font-size: 20px; 105 font-size: $large-font;
149 } 106 }
150 107
151 h5 108 h5
152 { 109 {
153 font-size: 16px; 110 font-size: $medium-font;
154 } 111 }
155 112
156 h6 113 h6
157 { 114 {
158 font-size: 14px; 115 font-size: $small-font;
159 } 116 }
160 117
161 /* Block elements 118 /* Body content
162 ******************************************************************************/ 119 ******************************************************************************/
120
121 abbr
122 {
123 text-decoration: underline dotted;
saroyanm 2016/11/21 18:44:36 Apparently shorthand properties are only supported
juliandoucette 2016/11/22 00:54:03 Acknowledged.
juliandoucette 2016/11/25 16:28:43 Done.
124 cursor: help;
125 }
126
127 b,
128 strong
129 {
130 font-weight: $bold-weight;
131 }
132
133 small
134 {
135 font-size: $small-font;
136 }
137
138 sup
139 {
140 position: relative;
141 font-size: 75%;
142 vertical-align: super;
143 }
144
145 a,
146 a:visited
147 {
148 color: $accent;
149 /* Remove the gray background on active links in IE 10. */
150 background-color: transparent;
151 text-decoration: none;
152 }
153
154 a:hover,
155 a:active,
156 a:focus
157 {
158 text-decoration: underline;
159 }
160
161 img
162 {
163 /* Make fixed width images responsive */
164 max-width: 100%;
165 /* Remove the border on images inside links in IE 10-. */
166 border-style: none;
167 }
163 168
164 hr 169 hr
saroyanm 2016/11/10 16:30:46 Detail: In HTML "hr" element is missing.
juliandoucette 2016/11/10 17:42:09 Acknowledged.
juliandoucette 2016/11/11 16:27:11 Done. Added.
165 { 170 {
166 /* Add the correct box sizing in Firefox. */ 171 border: 1px solid $secondary-light;
saroyanm 2016/11/10 16:30:45 What is the problem with border-box reset we have
juliandoucette 2016/11/10 17:42:06 Acknowledged.
juliandoucette 2016/11/11 16:27:11 Done.
167 box-sizing: content-box; 172 }
168 /* Show the overflow in Edge and IE. */
169 overflow: visible;
saroyanm 2016/11/10 16:30:44 Not really sure why we need overflow property on h
juliandoucette 2016/11/10 17:42:10 It depends on how we style hr. The default style i
juliandoucette 2016/11/11 16:27:12 Done. Removed. These styles were not necessary fo
170 height: 0px;
saroyanm 2016/11/10 16:30:45 note: Feels like this style belongs to normalize.c
juliandoucette 2016/11/10 17:42:09 I put the normalize.css things that apply to conte
juliandoucette 2016/11/11 16:27:12 Most of the normalize.css changes are made irrelev
171 border: 1px solid $gray;
172 }
173
174 /* Blockquotes */
175 173
176 [dir="ltr"] blockquote 174 [dir="ltr"] blockquote
177 { 175 {
178 padding-left: $small-space; 176 padding-left: $small-space;
179 border-left: 5px solid $gray; 177 border-left: 5px solid $secondary-light;
180 } 178 }
181 179
182 [dir="rtl"] blockquote 180 [dir="rtl"] blockquote
183 { 181 {
184 padding-right: $small-space; 182 padding-right: $small-space;
185 border-right: 5px solid $gray; 183 border-right: 5px solid $secondary-light;
186 } 184 }
187
188 /* Code blocks */
189
190 pre
191 {
192 overflow: auto;
193 padding: 0px $small-space;
194 }
195
196 code
197 {
198 padding: 0px $small-space / 4;
199 }
200
201 pre,
202 code
203 {
204 background-color: $gray-light;
205 /* Correct odd font inheritance in all browsers. */
saroyanm 2016/11/10 16:30:45 Detail: seems like this also part of normalization
juliandoucette 2016/11/10 17:42:08 See comment above.
juliandoucette 2016/11/11 16:27:12 Correction: These comments are no longer valid be
206 font-family: $monospace-font;
207 /* Correct the odd font sizing in all browsers. */
208 font-size: $medium-font;
209 }
210
211 pre code
212 {
213 padding: 0px;
214 }
215
216 /* Lists */
217 185
218 [dir="ltr"] ol, 186 [dir="ltr"] ol,
219 [dir="ltr"] ul 187 [dir="ltr"] ul
220 { 188 {
221 padding-left: $small-space * 1.5; 189 padding-left: $small-space * 1.5;
222 } 190 }
223 191
224 [dir="rtl"] ol, 192 [dir="rtl"] ol,
225 [dir="rtl"] ul 193 [dir="rtl"] ul
226 { 194 {
(...skipping 23 matching lines...) Expand all
250 { 218 {
251 /* undo browser default (opinionated)*/ 219 /* undo browser default (opinionated)*/
252 font-weight: $bold-weight; 220 font-weight: $bold-weight;
253 } 221 }
254 222
255 dd 223 dd
256 { 224 {
257 margin: $small-space / 2 0px $small-space 0px; 225 margin: $small-space / 2 0px $small-space 0px;
258 } 226 }
259 227
260 /** Unstyled lists */ 228 /**
261 229 * Remove list style from vertical lists
juliandoucette 2016/11/27 21:45:36 Note. Removed .unstyled-list because it cannot be
230 */
262 .unstyled-list, 231 .unstyled-list,
263 .unstyled-list ul
264 { 232 {
265 list-style-type: none; 233 list-style-type: none;
266 } 234 }
267 235
268 [dir="ltr"] .unstyled-list 236 [dir="ltr"] .unstyled-list
269 { 237 {
270 padding-left: 0px; 238 padding-left: 0px;
271 } 239 }
272 240
273 [dir="rtl"] .unstyled-list 241 [dir="rtl"] .unstyled-list
274 { 242 {
275 padding-right: 0px; 243 padding-right: 0px;
276 } 244 }
277 245
278 [dir="ltr"] .unstyled-list ul 246 [dir="ltr"] .unstyled-list .unstyled-list
279 { 247 {
280 padding-left: $medium-space; 248 padding-left: $medium-space;
281 } 249 }
282 250
283 [dir="rtl"] .unstyled-list ul 251 [dir="rtl"] .unstyled-list .unstyled-list
284 { 252 {
285 padding-right: $small-space; 253 padding-right: $small-space;
286 } 254 }
287 255
288 /* Embeds */ 256 /* Alignment
289 257 ******************************************************************************/
290 audio, 258
291 video 259 .full-width
292 { 260 {
293 /* undo browser default (opinionated) */
294 display: block; 261 display: block;
295 }
296
297 /** Responsive 16x9 YouTube video */
298
299 .youtube-16x9
saroyanm 2016/11/10 16:30:44 Why youtube ? I think this style shouldn't have sp
juliandoucette 2016/11/10 17:42:09 Acknowledged. I thought it was simpler for conten
juliandoucette 2016/11/11 16:27:09 Done. I changed it back to .embed and added a com
300 {
301 display: block;
302 position: relative;
303 overflow: hidden;
304 height: 0px;
saroyanm 2016/11/10 16:30:45 I thought we decided to remove this property.
juliandoucette 2016/11/10 17:42:07 Acknowledged.
juliandoucette 2016/11/11 16:27:14 Done.
305 padding: 0% 0% 56.25% 0%;
306 }
307
308 .youtube-16x9 iframe
309 {
310 position: absolute;
311 top: 0px;
312 bottom: 0px;
saroyanm 2016/11/10 16:30:44 I thought we decided to skip this property.
juliandoucette 2016/11/10 17:42:06 Acknowledged.
juliandoucette 2016/11/11 16:27:10 Done.
313 left: 0px;
314 width: 100%;
315 height: 100%;
316 border: 0px;
317 }
318
319 /* Inline elements
320 ******************************************************************************/
321
322 abbr[title]
saroyanm 2016/11/10 16:30:43 I wonder if there will be cases when we will use a
juliandoucette 2016/11/10 17:42:06 Acknowledged. This came from normalize.
juliandoucette 2016/11/11 16:27:10 Done.
323 {
324 /* Remove the bottom border in Firefox 39-. */
saroyanm 2016/11/10 16:30:43 We do support 48.0+ I think make sense to only con
juliandoucette 2016/11/10 17:42:08 Acknowledged. I could have used this link a long
juliandoucette 2016/11/11 16:27:13 Done.
325 border-bottom: none;
326 /* Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. */
327 text-decoration: underline dotted;
328 cursor: help;
329 }
330
331 b,
332 strong
333 {
334 font-weight: $bold-weight;
335 }
336
337 small
338 {
339 font-size: $small-font;
340 }
341
342 sup
343 {
344 position: relative;
345 top: -0.5em;
346 /* Prevent `sub` and `sup` elements from affecting the line height in
saroyanm 2016/11/10 16:30:46 detail: I think this comment should refer to the l
juliandoucette 2016/11/10 17:42:08 Acknowledged. It does, according to normalize.css
juliandoucette 2016/11/11 16:27:10 Done. I moved and shortened the comment.
347 all browsers. */
348 font-size: 75%;
349 line-height: 0px;
350 vertical-align: baseline;
351 }
352
353 /* Links */
354
355 a,
356 a:visited
357 {
358 /* Set default color and decoration (opinionated) */
359 color: $accent;
360 /* Remove the gray background on active links in IE 10. */
361 background-color: transparent;
362 text-decoration: none;
363 }
364
365 a:hover,
366 a:active,
367 a:focus
368 {
369 /* Set default color and decoration (opinionated) */
370 text-decoration: underline;
371 }
372
373 /* Images */
374
375 img
376 {
377 margin: 0px $small-space / 2;
378 /* Remove the border on images inside links in IE 10-. */
379 border-style: none;
380 }
381
382 /* Alignment
383 ******************************************************************************/
384
385 .block,
386 .float-start,
387 .float-end
388 {
389 display: block;
390 margin: 0px 0px $small-space 0px;
391 }
392
393 /** Display full-width */
394
395 .block
396 {
397 display: block;
398 clear: both;
399 overflow: auto;
400 width: 100%; 262 width: 100%;
401 margin: $small-space 0px; 263 margin: $small-space 0px;
402 } 264 }
403
404 /** Float to start-of-line */
405
406 [dir="ltr"] .float-start
407 {
408 float: left;
409 margin-right: $small-space;
410 }
411
412 [dir="rtl"] .float-start
413 {
414 float: right;
415 margin-left: $small-space;
416 }
417
418 /** Float to end-of-line */
419
420 [dir="ltr"] .float-end
421 {
422 float: right;
423 margin-left: $small-space;
424 }
425
426 [dir="rtl"] .float-end
427 {
428 float: left;
429 margin-right: $small-space;
430 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld