Skip to content

Commit bd9f274

Browse files
zkamvarfmichonneau
authored andcommitted
change px to em
I used the conversion for 1px = 0.0625em based on a default 16pt font This will address part of carpentries/styles#630
1 parent 9be301d commit bd9f274

File tree

1 file changed

+40
-40
lines changed

1 file changed

+40
-40
lines changed

assets/css/lesson.scss

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ $color-testimonial: #fc8dc1 !default;
3232

3333
@mixin cdSetup($color) {
3434
color: $color;
35-
border: solid 1px $color;
36-
border-left: solid 5px $color;
37-
margin: 15px 5px 10px 0;
38-
border-radius: 4px 0 0 4px;
35+
border: solid 0.065em $color;
36+
border-left: solid 0.325em $color;
37+
margin: 0.975em 0.325em 0.65em 0;
38+
border-radius: 0.26em 0 0 0.26em;
3939
}
4040

4141
// Generic setup. Has to come before .error, .warning, and .output
@@ -54,7 +54,7 @@ div[class^='language-']::before {
5454
background-color: #f2eff6;
5555
display: block;
5656
font-weight: bold;
57-
padding: 5px 10px;
57+
padding: 0.325em 0.65em;
5858
}
5959

6060
div[class^='language-']::before,
@@ -93,20 +93,20 @@ div.language-vulkan::before { content: "Vulkan"; }
9393

9494
// Tab panels are used on Setup pages to show instructions for different Operating Systems
9595
.tab-pane {
96-
border: solid 1px #ddd; // #ddd == @nav-tabs-active-link-hover-border-color
96+
border: solid 0.065em #ddd; // #ddd == @nav-tabs-active-link-hover-border-color
9797
border-top: none;
98-
padding: 20px 20px 10px 20px;
99-
border-radius: 0 0 4px 4px; // 4px == @border-radius-base
98+
padding: 1.3em 1.3em 0.65em 1.3em;
99+
border-radius: 0 0 0.26em 0.26em; // 0.26em == @border-radius-base
100100
}
101101

102102
// Stripe above tab panels where OS tabs are shown
103103
ul.nav.nav-tabs {
104104
background: #E1E1E1;
105-
border-radius: 4px 4px 0 0; // 4px == @border-radius-base
105+
border-radius: 0.26em 0.26em 0 0; // 0.26em == @border-radius-base
106106
}
107107

108-
// adjust line height of links so that clickable area (of OS tabs) is 44px high
109-
ul.nav.nav-tabs li a { line-height: 24px; } // or 1.714285716
108+
// adjust line height of links so that clickable area (of OS tabs) is 2.86em high
109+
ul.nav.nav-tabs li a { line-height: 1.56em; } // or 1.714285716
110110

111111
// This color provides better contrast ratio on most backgrounds used on Carpentries websites
112112
// 9.24 on FFFFFF: https://webaim.org/resources/contrastchecker/?fcolor=204A6F&bcolor=FFFFFF&api (body)
@@ -118,11 +118,11 @@ a { color: #204A6F; }
118118
.yt-wrapper2 { max-width: 100%; margin: 0 auto; }
119119

120120
// Use full width on small displays
121-
@media only screen and (max-width: 600px) { .yt-wrapper2 { max-width: 100%; } }
121+
@media only screen and (max-width: 39em) { .yt-wrapper2 { max-width: 100%; } }
122122

123123
.yt-wrapper {
124124
height: 0;
125-
margin-top: 10px;
125+
margin-top: 0.65em;
126126
padding-bottom: 56.25%;
127127
position: relative;
128128
width: 100%;
@@ -140,27 +140,27 @@ a { color: #204A6F; }
140140
// Specialized blockquote environments for learning objectives, callouts, etc.
141141
//----------------------------------------
142142

143-
$codeblock-padding: 5px !default;
143+
$codeblock-padding: 0.325em !default;
144144

145145
@mixin bkSetup($color, $glyph) {
146146

147147
$gradientcolor1: $color;
148148
$gradientcolor2: scale-color($color, $lightness: 10%);
149149

150150
padding: 0 0 $codeblock-padding $codeblock-padding;
151-
border: 1px solid;
151+
border: 0.065em solid;
152152
border-color: $color;
153-
border-radius: 4px;
153+
border-radius: 0.26em;
154154

155-
margin: 15px 5px 10px 0;
155+
margin: 0.975em 0.325em 0.65em 0;
156156

157157
h2 {
158158
padding-top: $codeblock-padding;
159159
padding-bottom: $codeblock-padding;
160-
font-size: 20px;
160+
font-size: 1.3em;
161161
background: linear-gradient(to bottom, $gradientcolor1, $gradientcolor2);
162162
border-color: $color;
163-
margin-top: 0px;
163+
margin-top: 0em;
164164
margin-left: -$codeblock-padding; // to move back to the left margin of the enclosing blockquote
165165
}
166166
h2:before {
@@ -195,7 +195,7 @@ $codeblock-padding: 5px !default;
195195
.prereq h3,
196196
.solution h3,
197197
.testimonial h3 {
198-
font-size: 18px;
198+
font-size: 1.17em;
199199
}
200200

201201
.challenge { background-color: #eec27520; }
@@ -210,7 +210,7 @@ font-size: 18px;
210210
.testimonial { background-color: #fc8dc120; }
211211

212212
blockquote p {
213-
margin: 5px;
213+
margin: 0.325em;
214214
}
215215
blockquote :not(h2) + p {
216216
padding-top: 1em;
@@ -242,19 +242,19 @@ a:visited {
242242

243243
code {
244244
white-space: nowrap;
245-
padding: 2px 5px;
245+
padding: 0.13em 0.325em;
246246
color: #24292e;
247247
background-color: #e7e7e7;
248248
}
249249

250250
samp { hyphens: none; }
251251

252-
dt { margin-top: 20px; }
252+
dt { margin-top: 1.3em; }
253253
dd { margin-left: 2em; }
254254

255255
article img {
256256
display: block;
257-
margin: 20px auto;
257+
margin: 1.3em auto;
258258
max-width: 100%;
259259
}
260260

@@ -264,13 +264,13 @@ article img.inline {
264264
}
265265

266266
article h2 {
267-
margin: 48px 0 16px;
268-
border-bottom: solid 1px #eaecef;
267+
margin: 3.12em 0 1.04em;
268+
border-bottom: solid 0.065em #eaecef;
269269
padding-bottom: 0.3em;
270270
line-height: 1.25;
271271
}
272272

273-
article h3 { margin: 40px 0 16px; }
273+
article h3 { margin: 2.6em 0 1.04em; }
274274

275275
article pre {
276276
margin: 0;
@@ -281,7 +281,7 @@ article pre {
281281
// Miscellaneous.
282282
//----------------------------------------
283283

284-
.figures h2 { margin-top: 100px; }
284+
.figures h2 { margin-top: 6.5em; }
285285

286286
.maintitle {
287287
text-align: center;
@@ -295,16 +295,16 @@ footer .license,
295295
footer .help-links
296296
{
297297
font-size: inherit;
298-
margin-top: 10px;
299-
margin-bottom: 10px;
298+
margin-top: 0.65em;
299+
margin-bottom: 0.65em;
300300
font-weight: 500;
301301
line-height: 1.1;
302302
}
303303

304304
img.navbar-logo {
305-
height: 40px; // synchronize with height of navbar
306-
padding-top: 5px;
307-
padding-right: 10px;
305+
height: 2.6em; // synchronize with height of navbar
306+
padding-top: 0.325em;
307+
padding-right: 0.65em;
308308
}
309309

310310
div.branding {
@@ -333,7 +333,7 @@ img {
333333

334334
p.image-with-shadow img,
335335
img.image-with-shadow {
336-
box-shadow: 0 6px 24px 0 #888;
336+
box-shadow: 0 0.39em 1.56em 0 #888;
337337
}
338338

339339
//----------------------------------------
@@ -347,7 +347,7 @@ div.life-cycle {
347347
z-index: 100;
348348
font-size: 1.2em;
349349
text-align: center;
350-
margin-bottom: -1px;
350+
margin-bottom: -0.065em;
351351
border-radius: 0;
352352
}
353353

@@ -387,14 +387,14 @@ kbd {
387387
margin: 0 .1em;
388388
padding: .1em .6em;
389389
font-family: Arial,"Helvetica Neue",Helvetica,sans-serif;
390-
font-size: 11px;
390+
font-size: 0.715em;
391391
line-height: 1.4;
392392
color: #242729;
393-
text-shadow: 0 1px 0 #FFF;
393+
text-shadow: 0 0.065em 0 #FFF;
394394
background-color: #e1e3e5;
395-
border: 1px solid #adb3b9;
396-
border-radius: 3px;
397-
box-shadow: 0 1px 0 rgba(12,13,14,0.2), 0 0 0 2px #FFF inset;
395+
border: 0.065em solid #adb3b9;
396+
border-radius: 0.195em;
397+
box-shadow: 0 0.065em 0 rgba(12,13,14,0.2), 0 0 0 0.13em #FFF inset;
398398
white-space: nowrap;
399399
font-style: normal;
400400
}

0 commit comments

Comments
 (0)