@canopycanopycanopy/b-ber-theme-serif 2.0.0 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,49 +4,49 @@
4
4
 
5
5
  // Text Sizes
6
6
  h1 {
7
- @include type-settings(0);
7
+ @include text-large;
8
8
  margin-top: 0;
9
9
  margin-bottom: 0;
10
10
  padding-top: one-line(0);
11
11
  padding-bottom: one-line(0);
12
12
  }
13
13
  h2 {
14
- @include type-settings(0);
14
+ @include text-large;
15
15
  margin-top: 0;
16
16
  margin-bottom: 0;
17
17
  padding-top: one-line(0);
18
18
  padding-bottom: one-line(0);
19
19
  }
20
20
  h3 {
21
- @include type-settings(0);
21
+ @include text-large;
22
22
  margin-top: 0;
23
23
  margin-bottom: 0;
24
24
  padding-top: one-line(0);
25
25
  padding-bottom: one-line(0);
26
26
  }
27
27
  h4 {
28
- @include type-settings(0);
28
+ @include text-large;
29
29
  margin-top: 0;
30
30
  margin-bottom: 0;
31
31
  padding-top: one-line(0);
32
32
  padding-bottom: one-line(0);
33
33
  }
34
34
  h5 {
35
- @include type-settings(0);
35
+ @include text-large;
36
36
  margin-top: 0;
37
37
  margin-bottom: 0;
38
38
  padding-top: one-line(0);
39
39
  padding-bottom: one-line(0);
40
40
  }
41
41
  h6 {
42
- @include type-settings(0);
42
+ @include text-large;
43
43
  margin-top: 0;
44
44
  margin-bottom: 0;
45
45
  padding-top: one-line(0);
46
46
  padding-bottom: one-line(0);
47
47
  }
48
48
  p {
49
- @include type-settings(0);
49
+ @include text-large;
50
50
  }
51
51
 
52
52
  section {
@@ -92,7 +92,7 @@ h4,
92
92
  h5,
93
93
  h6 {
94
94
  @include hyphens(none);
95
- @include type-settings(0);
95
+ @include text-large;
96
96
  @include following-paragraph-not-indented;
97
97
  text-indent: 0;
98
98
  text-transform: none;
@@ -111,7 +111,7 @@ a:visited {
111
111
  h1 {
112
112
  padding-bottom: four-lines(0);
113
113
  section & {
114
- @include padding(0, 0, 4, 0, 0);
114
+ @include padding('text-large', 0, 0, 4, 0);
115
115
  }
116
116
 
117
117
  &.book-title,
@@ -120,8 +120,8 @@ h1 {
120
120
  }
121
121
 
122
122
  section.backmatter & {
123
- @include type-settings(-1);
124
- @include padding(2, 0, 2, 0, -1);
123
+ @include text-medium;
124
+ @include padding('text-medium', 2, 0, 2, 0);
125
125
  }
126
126
 
127
127
  section.titlepage & {
@@ -139,19 +139,19 @@ h1 {
139
139
  section.credits &,
140
140
  section.contributors &,
141
141
  section.appendix & {
142
- @include padding(0, 0, 4, 0, -1);
142
+ @include padding('text-medium', 0, 0, 4, 0);
143
143
  @include following-paragraph-not-indented;
144
144
  }
145
145
  }
146
146
 
147
147
  h2 {
148
148
  section & {
149
- @include padding(0, 0, 1, 0, 0);
149
+ @include padding('text-large', 0, 0, 1, 0);
150
150
  }
151
151
 
152
152
  section.backmatter & {
153
- @include type-settings(-1);
154
- @include padding(1, 0, 0, 0, -1);
153
+ @include text-medium;
154
+ @include padding('text-medium', 1, 0, 0, 0);
155
155
  }
156
156
 
157
157
  section.titlepage & {
@@ -163,25 +163,25 @@ h2 {
163
163
  section.credits &,
164
164
  section.contributors &,
165
165
  section.appendix & {
166
- @include type-settings(-1);
167
- @include padding(0, 0, 1, 0, -1);
166
+ @include text-medium;
167
+ @include padding('text-medium', 0, 0, 1, 0);
168
168
  @include following-paragraph-not-indented;
169
169
  }
170
170
  }
171
171
 
172
172
  h3 {
173
173
  section.titlepage & {
174
- @include type-settings(-4);
174
+ @include text-xsmall;
175
175
  padding-bottom: one-line(-4);
176
176
  }
177
177
  }
178
178
 
179
179
  p {
180
- @include type-settings(0);
180
+ @include text-large;
181
181
  text-indent: one-em(0);
182
182
 
183
183
  blockquote & {
184
- @include type-settings(-2);
184
+ @include text-small;
185
185
  text-indent: 0 !important; // sass-lint:disable-line no-important
186
186
  margin-bottom: 0 !important; // sass-lint:disable-line no-important
187
187
  }
@@ -198,14 +198,14 @@ p {
198
198
  text-indent: one-em(0);
199
199
  }
200
200
  @include following-paragraph-not-indented;
201
- @include type-settings(-2);
202
- @include padding(0, 0, 1, 0, -2);
201
+ @include text-small;
202
+ @include padding('text-small', 0, 0, 1, 0);
203
203
  }
204
204
 
205
205
  section.colophon & {
206
206
  @include following-paragraph-not-indented;
207
- @include type-settings(-2);
208
- @include padding(0, 0, 1, 0, -2);
207
+ @include text-small;
208
+ @include padding('text-small', 0, 0, 1, 0);
209
209
  text-indent: 0 !important; // sass-lint:disable-line no-important
210
210
  }
211
211
 
@@ -221,17 +221,17 @@ p {
221
221
  }
222
222
 
223
223
  section.frontmatter.dedication & {
224
- @include type-settings(0);
225
- @include padding(0, 1, 1, 0, 0);
224
+ @include text-large;
225
+ @include padding('text-large', 0, 1, 1, 0);
226
226
  text-indent: 0;
227
227
  }
228
228
 
229
229
  section.dialogue & {
230
230
  &.interlocutor-parent {
231
- @include padding(1, 0, 0, 0, 0);
231
+ @include padding('text-large', 1, 0, 0, 0);
232
232
  margin-top: 0;
233
233
  .interlocutor {
234
- @include type-settings(-8);
234
+ @include sup-text;
235
235
  line-height: 1;
236
236
  font-family: $sans;
237
237
  font-weight: bold;
@@ -255,7 +255,7 @@ p {
255
255
 
256
256
  .pullquote & {
257
257
  @include following-paragraph-not-indented;
258
- @include type-settings(-4);
258
+ @include text-xsmall;
259
259
  text-indent: 0 !important; // sass-lint:disable-line no-important
260
260
  margin-bottom: 0 !important; // sass-lint:disable-line no-important
261
261
  font-style: italic;
@@ -268,7 +268,7 @@ p {
268
268
 
269
269
  .epigraph .pullquote & {
270
270
  @include following-paragraph-not-indented;
271
- @include type-settings(0);
271
+ @include text-large;
272
272
  float: none;
273
273
  width: 100%;
274
274
  margin-top: 0 !important; // sass-lint:disable-line no-important
@@ -290,7 +290,7 @@ cite {
290
290
  .pullquote &,
291
291
  blockquote & {
292
292
  @include following-paragraph-not-indented;
293
- @include type-settings(-4);
293
+ @include text-xsmall;
294
294
  font-weight: normal;
295
295
  font-style: normal;
296
296
  text-indent: 0;
@@ -305,7 +305,7 @@ cite {
305
305
  }
306
306
  .epigraph .pullquote & {
307
307
  @include following-paragraph-not-indented;
308
- @include type-settings(0);
308
+ @include text-large;
309
309
  float: none;
310
310
  width: 100%;
311
311
  text-align: center;
@@ -320,7 +320,7 @@ cite {
320
320
  // Inline elements
321
321
  sup,
322
322
  sub {
323
- @include type-settings(-8);
323
+ @include sup-text;
324
324
  line-height: 1;
325
325
  color: $black;
326
326
  vertical-align: baseline;
@@ -344,7 +344,7 @@ small {
344
344
  }
345
345
 
346
346
  pre {
347
- @include padding(1, 1, 1, 1, 0);
347
+ @include padding('text-large', 1, 1, 1, 1);
348
348
  margin-bottom: one-line(0);
349
349
  font-size: 1em;
350
350
  line-height: 1;
@@ -411,7 +411,7 @@ span.footnote-ref {
411
411
  @extend sup;
412
412
  }
413
413
  .footnote__body {
414
- @include padding(1, 0, 1, 0, 0);
414
+ @include padding('text-large', 1, 0, 1, 0);
415
415
  }
416
416
  }
417
417
 
@@ -101,7 +101,7 @@
101
101
  // Publication title is the first element in the TOC panel.
102
102
  .publication__title {
103
103
  @include web-navigation-link;
104
- @include type-settings(-2);
104
+ @include text-small;
105
105
  height: $dimensions-large-x;
106
106
  display: flex;
107
107
  align-items: center;
@@ -124,7 +124,7 @@
124
124
  justify-content: flex-end;
125
125
 
126
126
  .publication__search__input {
127
- @include type-settings(-2);
127
+ @include text-small;
128
128
  border: 0;
129
129
  display: block;
130
130
  margin: 0;
@@ -156,7 +156,7 @@
156
156
 
157
157
  // The table of contents, which is an ordered, nested list.
158
158
  .publication__toc {
159
- @include type-settings(-7);
159
+ @include caption-text;
160
160
  transform: translateX(-100%);
161
161
  position: fixed;
162
162
  z-index: 2;
@@ -200,7 +200,7 @@
200
200
  }
201
201
 
202
202
  .publication__info {
203
- @include type-settings(-7);
203
+ @include caption-text;
204
204
  transform: translateX(100%);
205
205
  position: fixed;
206
206
  z-index: 1;
@@ -274,7 +274,7 @@
274
274
 
275
275
  // Header styles
276
276
  .publication__header {
277
- @include type-settings(-7);
277
+ @include caption-text;
278
278
  @include web-grid-full-width;
279
279
  grid-row: 1;
280
280
 
@@ -294,7 +294,7 @@
294
294
 
295
295
  h1 {
296
296
  @include web-navigation-link;
297
- @include type-settings(-2);
297
+ @include text-small;
298
298
  padding: 0;
299
299
  margin: 0;
300
300
  }
@@ -361,36 +361,36 @@
361
361
  // easily by using container directives, like `::: chapter`.
362
362
  //
363
363
  .publication__contents {
364
- @include padding(4, 0, 3, 0, 0);
365
- grid-row: 2;
366
-
367
- @include web-grid-container; // We can't use `display: subgrid` so it is re-declared.
368
- @include web-grid-full-width; // `publication__contents` spans the entire page
369
- grid-template-rows: max-content; // https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-rows
370
- * {
371
- @include web-grid-full-width;
372
- } // All elements (except for `sections`, see below) also span the entire page.
373
-
374
- section {
375
- // `section` elements are also CSS Grid containers.
376
- @include web-grid-container;
377
- @include web-grid-full-width;
378
- *:not(section) {
379
- // All child elements of a `section` (except for other `section`s)
380
- // span a smaller area by default. This allows overrides to be
381
- // easily applied to child elements in `_overrides.scss` to create
382
- // more complex layouts.
383
-
384
- grid-column: 4 / span 6;
385
-
386
- @include break('mobile') {
387
- grid-column: 2 / span 10;
388
- }
389
- @include break('tablet') {
390
- grid-column: 2 / span 10;
391
- }
392
- }
393
- }
364
+ @include padding('text-large', 4, 0, 3, 0);
365
+ // grid-row: 2;
366
+
367
+ // @include web-grid-container; // We can't use `display: subgrid` so it is re-declared.
368
+ // @include web-grid-full-width; // `publication__contents` spans the entire page
369
+ // grid-template-rows: max-content; // https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-rows
370
+ // * {
371
+ // @include web-grid-full-width;
372
+ // } // All elements (except for `sections`, see below) also span the entire page.
373
+
374
+ // section {
375
+ // // `section` elements are also CSS Grid containers.
376
+ // @include web-grid-container;
377
+ // @include web-grid-full-width;
378
+ // *:not(section) {
379
+ // // All child elements of a `section` (except for other `section`s)
380
+ // // span a smaller area by default. This allows overrides to be
381
+ // // easily applied to child elements in `_overrides.scss` to create
382
+ // // more complex layouts.
383
+
384
+ // grid-column: 4 / span 6;
385
+
386
+ // @include break-at('xs') {
387
+ // grid-column: 2 / span 10;
388
+ // }
389
+ // @include break-at('sm') {
390
+ // grid-column: 2 / span 10;
391
+ // }
392
+ // }
393
+ // }
394
394
 
395
395
  // Logic for overlay when sidebar open
396
396
  &:before {
@@ -459,7 +459,7 @@
459
459
  }
460
460
 
461
461
  // Media queries
462
- @include break('mobile') {
462
+ @include break-at('xs') {
463
463
  // Sidebars
464
464
  .publication__toc,
465
465
  .publication__info {
@@ -545,7 +545,7 @@
545
545
  }
546
546
 
547
547
  // Mobile Overrides for Galleries, Fullbleed images, and spreads.
548
- @include break('mobile') {
548
+ @include break-at('xs') {
549
549
  // Fullbleed
550
550
  .figure__fullbleed.figure__inline--landscape .figure__items {
551
551
  height: auto;
@@ -0,0 +1,10 @@
1
+ @import 'container';
2
+ @import 'figure';
3
+ @import 'layout';
4
+ @import 'list';
5
+ @import 'table';
6
+ @import 'text';
7
+ @import 'media';
8
+ @import 'web';
9
+ @import 'reader';
10
+ @import 'print';
@@ -0,0 +1,45 @@
1
+ @mixin caption {
2
+ @include caption-text;
3
+ line-height: 1.3;
4
+ margin-bottom: 0;
5
+ text-align: left;
6
+ text-indent: 0 !important;
7
+ }
8
+
9
+ @mixin bullet-container {
10
+ text-indent: 0;
11
+ margin-left: one-em(0);
12
+ }
13
+
14
+ @mixin bullet {
15
+ display: inline-block;
16
+ text-indent: one-em(0) * -1;
17
+ }
18
+
19
+ // Utility for sizing video iframe. Dimensions are variable based on whether the
20
+ // view is 'portrait' or 'landscape'. Called in media queries.
21
+ @mixin iframe($orientation, $ratio-a, $ratio-b) {
22
+ $width: 100%;
23
+ $height: 100%;
24
+ $left: 50%;
25
+ $transform: translateX(-50%);
26
+
27
+ @if $orientation == 'portrait' {
28
+ $width: $ratio-a / $ratio-b * 100vh;
29
+ $height: 100vh;
30
+ } @else if $orientation == 'landscape' {
31
+ $width: 100vw;
32
+ $height: $ratio-b / $ratio-a * 100vw;
33
+ } @else {
34
+ @error "`iframe' mixin requires either `portrait' or `landscape' parameter.";
35
+ }
36
+
37
+ width: 100% !important;
38
+ min-width: $width;
39
+
40
+ height: $height !important;
41
+ min-height: 100%;
42
+
43
+ left: $left !important;
44
+ transform: $transform !important;
45
+ }
@@ -0,0 +1,21 @@
1
+ // font-face utility mixin
2
+ // @example @include font-face('MyFont', 'My-Font-File-Name', ('ttf'), 400, normal);
3
+ @mixin font-face(
4
+ $font-name,
5
+ $file-name,
6
+ $formats: ('ttf', 'otf'),
7
+ $weight: 400,
8
+ $style: normal
9
+ ) {
10
+ $filepath: '../fonts/' + $file-name;
11
+ @font-face {
12
+ font-family: '#{$font-name}';
13
+ @each $format in $formats {
14
+ src: url($filepath+'.'+$format);
15
+ }
16
+ font: {
17
+ weight: $weight;
18
+ style: $style;
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,51 @@
1
+ // Mobile
2
+ $mq-xs: 'only screen and (max-width: 768px)';
3
+
4
+ // Tablet
5
+ $mq-sm: 'only screen and (min-width: 769px) and (max-width: 1140px)';
6
+
7
+ // Desktop 1
8
+ $mq-md: 'only screen and (min-width: 1141px) and (max-width: 1440px)';
9
+
10
+ // Desktop 2
11
+ $mq-lg: 'only screen and (min-width: 1441px) and (max-width: 1920px)';
12
+
13
+ // Desktop 3
14
+ $mq-xl: 'only screen and (min-width: 1921px)';
15
+
16
+ $break-map: (
17
+ 'xs': $mq-xs,
18
+ 'sm': $mq-sm,
19
+ 'md': $mq-md,
20
+ 'lg': $mq-lg,
21
+ 'xl': $mq-xl,
22
+ );
23
+
24
+ // Media query mixin. Accepts multiple arguments. Because the media queries are
25
+ // relatively specific, it's simpler to wrap styles in multiple queries than to
26
+ // work from a 'global' base (i.e., a 'mobile-first' strategy). Called with
27
+ // a single value, or a comma separated list of values:
28
+ //
29
+ // @include break-at('mobile-portrait') { ... }
30
+ // @include break-at('mobile-portrait', 'tablet-portrait') { .. }
31
+ @mixin break-at($media...) {
32
+ $query: '';
33
+
34
+ @for $i from 1 through length($media) {
35
+ $value: map-get($break-map, nth($media, $i));
36
+
37
+ @if not $value {
38
+ @error "`#{$media}` is not a supported media query name.";
39
+ }
40
+
41
+ @if $query != '' {
42
+ $query: '#{$query}, #{$value}';
43
+ } @else {
44
+ $query: $value;
45
+ }
46
+ }
47
+
48
+ @media #{$query} {
49
+ @content;
50
+ }
51
+ }
@@ -290,7 +290,7 @@ $grid-row-height-percentage: (100% - $grid-row-gap-percentage) /
290
290
  grid-template: grid-template($grid-column-count, $row-height);
291
291
  grid-gap: grid-gap();
292
292
 
293
- @include break('mobile') {
293
+ @include break-at('xs') {
294
294
  grid-template: grid-template(round($grid-column-count / 2), 'auto');
295
295
  }
296
296
  }
@@ -309,7 +309,7 @@ $grid-row-height-percentage: (100% - $grid-row-gap-percentage) /
309
309
  // @param $bottom int Number of line-height units at type-settings(0) to add as padding-bottom
310
310
  // @param $right int Number of `em`s at type-settings(0) to add as padding-right
311
311
  // @param $value int Elements type-settings index
312
- // @example padding: @include padding(1, 1, 1, 1, 0) // => padding: 1em 1.3125em 1em 1.3125em;
312
+ // @example padding: @include padding(1, 1, 1, 1, 0); // => padding: 1em 1.3125em 1em 1.3125em;
313
313
  @mixin padding($top, $right, $bottom, $left, $value) {
314
314
  padding: adjust-line-height-value($value) * $top + 0em
315
315
  adjust-font-size-value($value) * $right + 0em
@@ -0,0 +1,51 @@
1
+ @mixin hyphens($hyphenation: auto) {
2
+ -epub-hyphens: $hyphenation;
3
+ adobe-hyphenate: $hyphenation;
4
+ hyphens: $hyphenation;
5
+ }
6
+
7
+ @mixin widows($n: 2) {
8
+ widows: $n;
9
+ }
10
+
11
+ @mixin orphans($n: 1) {
12
+ orphans: $n;
13
+ }
14
+
15
+ @mixin text-rendering($value: optimizeLegibility) {
16
+ text-rendering: $value;
17
+ }
18
+
19
+ @mixin font-smoothing {
20
+ -moz-osx-font-smoothing: grayscale;
21
+ -webkit-font-smoothing: antialiased;
22
+ }
23
+
24
+ @mixin variant-wght($weight-variant, $weight-static) {
25
+ font-weight: $weight-static; // Fallback
26
+ font-variation-settings: 'wght' $weight-variant;
27
+ }
28
+
29
+ @mixin following-paragraph-not-indented {
30
+ + p {
31
+ text-indent: 0 !important;
32
+ }
33
+ }
34
+
35
+ @mixin paragraph-not-indented {
36
+ margin-bottom: one-line(0);
37
+ text-indent: 0 !important;
38
+ }
39
+
40
+ @mixin following-element-has-no-top-padding {
41
+ + table,
42
+ + ul,
43
+ + ol,
44
+ + dl,
45
+ + blockquote {
46
+ margin-top: 0;
47
+ }
48
+ + hr {
49
+ margin-top: one-line(0);
50
+ }
51
+ }
@@ -0,0 +1,73 @@
1
+ @use "sass:math";
2
+
3
+ // Remove units from a value
4
+ // @example strip-unit(1em) // => 1
5
+ @function strip-unit($value) {
6
+ @if type-of($value) == 'number' and not unitless($value) {
7
+ // This looks bizare but needs to be divided by 1<unit> to yield an int
8
+ @return math.div($value, ($value * 0 + 1));
9
+ }
10
+
11
+ @return $value;
12
+ }
13
+
14
+ // Defaults to 16px, assuming the `html` element's base font size
15
+ @function em-to-px($value, $root-px: 16px) {
16
+ @return strip-unit($value) * strip-unit($root-px) + 0px;
17
+ }
18
+
19
+ // Utility function to cast a string to a number.
20
+ // https://www.sassmeister.com/gist/9fa19d254864f33d4a80
21
+ @function to-number($value) {
22
+ @if type-of($value) == 'number' {
23
+ @return $value;
24
+ } @else if type-of($value) != 'string' {
25
+ @error "Value for `to-number' must be a number or a string.";
26
+ }
27
+
28
+ $result: 0;
29
+ $digits: 0;
30
+ $minus: str-slice($value, 1, 1) == '-';
31
+ $numbers: (
32
+ '0': 0,
33
+ '1': 1,
34
+ '2': 2,
35
+ '3': 3,
36
+ '4': 4,
37
+ '5': 5,
38
+ '6': 6,
39
+ '7': 7,
40
+ '8': 8,
41
+ '9': 9,
42
+ );
43
+
44
+ @for $i from if($minus, 2, 1) through str-length($value) {
45
+ $character: str-slice($value, $i, $i);
46
+
47
+ @if not(index(map-keys($numbers), $character) or $character == '.') {
48
+ @return to-length(if($minus, -$result, $result), str-slice($value, $i));
49
+ }
50
+
51
+ @if $character == '.' {
52
+ $digits: 1;
53
+ } @else if $digits == 0 {
54
+ $result: $result * 10 + map-get($numbers, $character);
55
+ } @else {
56
+ $digits: $digits * 10;
57
+ $result: $result + map-get($numbers, $character) / $digits;
58
+ }
59
+ }
60
+
61
+ @return if($minus, -$result, $result);
62
+ }
63
+
64
+ // Utility function for extracting values from an aspect ratio string. '16x9'
65
+ // yields (16, 9). Used for class names and calculations for video dimensions.
66
+ @function aspect-ratio-values($string) {
67
+ $i: str-index($string, 'x');
68
+
69
+ $a: to-number(str-slice($string, 1, $i - 1));
70
+ $b: to-number(str-slice($string, $i + 1));
71
+
72
+ @return ($a, $b);
73
+ }