bitstyles 0.8.0

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.
Files changed (119) hide show
  1. checksums.yaml +7 -0
  2. data/.eslintignore +5 -0
  3. data/.eslintrc +4 -0
  4. data/.github/PULL_REQUEST_TEMPLATE.md +20 -0
  5. data/.gitignore +19 -0
  6. data/.nvmrc +1 -0
  7. data/.stylelintrc +166 -0
  8. data/CODE_OF_CONDUCT.md +49 -0
  9. data/Gemfile +4 -0
  10. data/LICENSE.txt +7 -0
  11. data/README.md +251 -0
  12. data/Rakefile +2 -0
  13. data/bin/console +14 -0
  14. data/bin/setup +8 -0
  15. data/bitstyles.gemspec +29 -0
  16. data/bower.json +31 -0
  17. data/build/.gitignore +4 -0
  18. data/lib/bitstyles/engine.rb +9 -0
  19. data/lib/bitstyles/version.rb +3 -0
  20. data/lib/bitstyles.rb +2 -0
  21. data/package.json +85 -0
  22. data/postcss_build.json +12 -0
  23. data/postcss_lint.json +11 -0
  24. data/scripts/styleguide.sh +16 -0
  25. data/scss/bitstyles/base/_figure.scss +9 -0
  26. data/scss/bitstyles/base/_forms.scss +182 -0
  27. data/scss/bitstyles/base/_hr.scss +6 -0
  28. data/scss/bitstyles/base/_images.scss +13 -0
  29. data/scss/bitstyles/base/_link.scss +32 -0
  30. data/scss/bitstyles/base/_media.scss +24 -0
  31. data/scss/bitstyles/base/_typography.scss +354 -0
  32. data/scss/bitstyles/components/_expander.scss +45 -0
  33. data/scss/bitstyles/components/_modal.scss +170 -0
  34. data/scss/bitstyles/generic/_box-sizing.scss +16 -0
  35. data/scss/bitstyles/generic/_normalize.scss +421 -0
  36. data/scss/bitstyles/layout/_content.scss +33 -0
  37. data/scss/bitstyles/layout/_grid.scss +148 -0
  38. data/scss/bitstyles/layout/_topbar.scss +25 -0
  39. data/scss/bitstyles/layout/_width.scss +48 -0
  40. data/scss/bitstyles/objects/_absolute-center.scss +16 -0
  41. data/scss/bitstyles/objects/_absolute-cover.scss +16 -0
  42. data/scss/bitstyles/objects/_block.scss +14 -0
  43. data/scss/bitstyles/objects/_bordered-header.scss +39 -0
  44. data/scss/bitstyles/objects/_break-long-words.scss +15 -0
  45. data/scss/bitstyles/objects/_button--icon.scss +30 -0
  46. data/scss/bitstyles/objects/_button.scss +103 -0
  47. data/scss/bitstyles/objects/_clearfix.scss +19 -0
  48. data/scss/bitstyles/objects/_expander.scss +45 -0
  49. data/scss/bitstyles/objects/_fixed-ratio.scss +23 -0
  50. data/scss/bitstyles/objects/_flex.scss +24 -0
  51. data/scss/bitstyles/objects/_hidden.scss +33 -0
  52. data/scss/bitstyles/objects/_icon.scss +43 -0
  53. data/scss/bitstyles/objects/_input.scss +83 -0
  54. data/scss/bitstyles/objects/_label.scss +15 -0
  55. data/scss/bitstyles/objects/_link.scss +29 -0
  56. data/scss/bitstyles/objects/_list-reset.scss +25 -0
  57. data/scss/bitstyles/objects/_media.scss +20 -0
  58. data/scss/bitstyles/objects/_truncate-with-ellipsis.scss +18 -0
  59. data/scss/bitstyles/objects/_typography.scss +92 -0
  60. data/scss/bitstyles/objects/_vertical-center.scss +16 -0
  61. data/scss/bitstyles/objects/_visuallyhidden.scss +30 -0
  62. data/scss/bitstyles/settings/_bordered-header.scss +3 -0
  63. data/scss/bitstyles/settings/_button--icon.scss +5 -0
  64. data/scss/bitstyles/settings/_button.scss +18 -0
  65. data/scss/bitstyles/settings/_content.scss +5 -0
  66. data/scss/bitstyles/settings/_global.animation.scss +3 -0
  67. data/scss/bitstyles/settings/_global.breakpoints.scss +12 -0
  68. data/scss/bitstyles/settings/_global.color-base.scss +14 -0
  69. data/scss/bitstyles/settings/_global.color-theme.scss +11 -0
  70. data/scss/bitstyles/settings/_global.layout.scss +7 -0
  71. data/scss/bitstyles/settings/_global.setup.scss +1 -0
  72. data/scss/bitstyles/settings/_global.typography.scss +28 -0
  73. data/scss/bitstyles/settings/_grid.scss +1 -0
  74. data/scss/bitstyles/settings/_hidden.scss +1 -0
  75. data/scss/bitstyles/settings/_icon.scss +5 -0
  76. data/scss/bitstyles/settings/_input.scss +12 -0
  77. data/scss/bitstyles/settings/_link.scss +4 -0
  78. data/scss/bitstyles/settings/_modal.scss +9 -0
  79. data/scss/bitstyles/settings/_topbar.scss +2 -0
  80. data/scss/bitstyles/settings/_visuallyhidden.scss +1 -0
  81. data/scss/bitstyles/settings/_width.scss +12 -0
  82. data/scss/bitstyles/tools/_absolute-center.scss +13 -0
  83. data/scss/bitstyles/tools/_absolute-cover.scss +13 -0
  84. data/scss/bitstyles/tools/_block.scss +9 -0
  85. data/scss/bitstyles/tools/_break-long-words.scss +11 -0
  86. data/scss/bitstyles/tools/_clearfix.scss +13 -0
  87. data/scss/bitstyles/tools/_fixed-ratio.scss +27 -0
  88. data/scss/bitstyles/tools/_flex.scss +15 -0
  89. data/scss/bitstyles/tools/_font-face.scss +21 -0
  90. data/scss/bitstyles/tools/_hidden.scss +11 -0
  91. data/scss/bitstyles/tools/_list-reset.scss +17 -0
  92. data/scss/bitstyles/tools/_media-query.scss +30 -0
  93. data/scss/bitstyles/tools/_media.scss +15 -0
  94. data/scss/bitstyles/tools/_truncate-with-ellipsis.scss +13 -0
  95. data/scss/bitstyles/tools/_typography-conversions.scss +18 -0
  96. data/scss/bitstyles/tools/_typography.scss +17 -0
  97. data/scss/bitstyles/tools/_vertical-center.scss +11 -0
  98. data/scss/bitstyles/tools/_visuallyhidden.scss +18 -0
  99. data/scss/bitstyles/tools/_width.scss +30 -0
  100. data/scss/bitstyles/tools/_zindex.scss +36 -0
  101. data/scss/bitstyles/trumps/_background-color.scss +18 -0
  102. data/scss/bitstyles/trumps/_color.scss +19 -0
  103. data/scss/bitstyles/trumps/_margin.scss +39 -0
  104. data/scss/bitstyles/trumps/_no-margin.scss +39 -0
  105. data/scss/bitstyles/trumps/_no-padding.scss +43 -0
  106. data/scss/bitstyles/trumps/_padding.scss +43 -0
  107. data/scss/bitstyles/trumps/_text-align.scss +21 -0
  108. data/scss/bitstyles/trumps/_text-style.scss +19 -0
  109. data/scss/bitstyles/trumps/_text-weight.scss +25 -0
  110. data/scss/bitstyles.scss +167 -0
  111. data/styleguide/assets/images/icons.svg +12 -0
  112. data/styleguide/assets/images/placeholder_16-9.png +0 -0
  113. data/styleguide/assets/images/placeholder_button.png +0 -0
  114. data/styleguide/assets/javascripts/a11y-dialog.js +135 -0
  115. data/styleguide/assets/javascripts/expander.js +40 -0
  116. data/styleguide/assets/javascripts/modal.js +55 -0
  117. data/styleguide/assets/javascripts/styleguide-init.js +6 -0
  118. data/styleguide/assets/stylesheets/styleguide-extras.css +17 -0
  119. metadata +192 -0
@@ -0,0 +1,92 @@
1
+ // Typography
2
+ //
3
+ // These typographic classes mimic the html elements `<h1>`..`<h6>` — use the semantically correct
4
+ // element in markup, then apply the correct class to achieve the correct visual appearance.
5
+ // Note the `.o-h0` has been added as an additional layer above `.o-h1`, use to acheive an extra-large
6
+ // 'hero' (using Bootstrap nomenclature) text.
7
+ //
8
+ // Markup:
9
+ // <h1 class="o-h0">Header 0</h1>
10
+ // <h2 class="o-h1">Header 1</h2>
11
+ // <h3 class="o-h2">Header 2</h3>
12
+ // <h4 class="o-h3">Header 3</h4>
13
+ // <h5 class="o-h4">Header 4</h5>
14
+ // <h6 class="o-h5">Header 5</h6>
15
+ // <h6 class="o-h5">Header 6</h6>
16
+ // <h1 class="o-h6">Header 6</h1>
17
+ // <h2 class="o-h5">Header 5</h2>
18
+ // <h3 class="o-h4">Header 4</h3>
19
+ // <h4 class="o-h3">Header 3</h4>
20
+ // <h5 class="o-h2">Header 2</h5>
21
+ // <h6 class="o-h1">Header 1</h6>
22
+ // <h6 class="o-h0">Header 0</h6>
23
+ //
24
+ // Styleguide 1.20
25
+
26
+ .#{$bitstyles-namespace}o-h0,
27
+ .#{$bitstyles-namespace}o-h1,
28
+ .#{$bitstyles-namespace}o-h2,
29
+ .#{$bitstyles-namespace}o-h3,
30
+ .#{$bitstyles-namespace}o-h4,
31
+ .#{$bitstyles-namespace}o-h5,
32
+ .#{$bitstyles-namespace}o-h6 {
33
+ @include generic-heading;
34
+ }
35
+
36
+ .#{$bitstyles-namespace}o-h0 {
37
+ @include font-size($bitstyles-font-size-h0-small);
38
+ }
39
+
40
+ .#{$bitstyles-namespace}o-h1 {
41
+ @include font-size($bitstyles-font-size-h1-small);
42
+ }
43
+
44
+ .#{$bitstyles-namespace}o-h2 {
45
+ @include font-size($bitstyles-font-size-h2-small);
46
+ }
47
+
48
+ .#{$bitstyles-namespace}o-h3 {
49
+ @include font-size($bitstyles-font-size-h3-small);
50
+ }
51
+
52
+ .#{$bitstyles-namespace}o-h4 {
53
+ @include font-size($bitstyles-font-size-h4-small);
54
+ }
55
+
56
+ .#{$bitstyles-namespace}o-h5 {
57
+ @include font-size($bitstyles-font-size-h5-small);
58
+ }
59
+
60
+ .#{$bitstyles-namespace}o-h6 {
61
+ @include font-size($bitstyles-font-size-h6-small);
62
+ }
63
+
64
+ @include media-query($bitstyles-typography-breakpoint) {
65
+ .#{$bitstyles-namespace}o-h0 {
66
+ @include font-size($bitstyles-font-size-h0, $bitstyles-font-size-base);
67
+ }
68
+
69
+ .#{$bitstyles-namespace}o-h1 {
70
+ @include font-size($bitstyles-font-size-h1, $bitstyles-font-size-base);
71
+ }
72
+
73
+ .#{$bitstyles-namespace}o-h2 {
74
+ @include font-size($bitstyles-font-size-h2, $bitstyles-font-size-base);
75
+ }
76
+
77
+ .#{$bitstyles-namespace}o-h3 {
78
+ @include font-size($bitstyles-font-size-h3, $bitstyles-font-size-base);
79
+ }
80
+
81
+ .#{$bitstyles-namespace}o-h4 {
82
+ @include font-size($bitstyles-font-size-h4, $bitstyles-font-size-base);
83
+ }
84
+
85
+ .#{$bitstyles-namespace}o-h5 {
86
+ @include font-size($bitstyles-font-size-h5, $bitstyles-font-size-base);
87
+ }
88
+
89
+ .#{$bitstyles-namespace}o-h6 {
90
+ @include font-size($bitstyles-font-size-h6, $bitstyles-font-size-base);
91
+ }
92
+ }
@@ -0,0 +1,16 @@
1
+ /** @define vertical-center */
2
+ //
3
+ // Vertical Centre
4
+ //
5
+ // Centres an element vertically (not horizontally). Uses absolute positioning, therefore outside the document flow.
6
+ //
7
+ // markup:
8
+ // <div class="background-grey min-height-block">
9
+ // <p class="o-vertical-center">Vertically-centred content here</p>
10
+ // </div>
11
+ //
12
+ // Styleguide 1.12
13
+
14
+ .#{$bitstyles-namespace}o-vertical-center {
15
+ @include vertical-center;
16
+ }
@@ -0,0 +1,30 @@
1
+ /** @define visuallyhidden */
2
+ //
3
+ // Visuallyhidden
4
+ //
5
+ // Hide an element visually while leaving it readable & accessible by google & screenreaders.
6
+ // Use to give more complete & understandable labels for UI e.g. display only 'next' on a button,
7
+ // but use `.visuallyhidden` to hide a span containing a more descriptive label.
8
+ // Available at every breakpoint set in `$visuallyhidden-breakpoints`.
9
+ //
10
+ // markup:
11
+ // <button class="o-button">
12
+ // <span class="o-button__label">Next</span>
13
+ // <span class="o-visuallyhidden">articles</span>
14
+ // </button>
15
+ //
16
+ // Styleguide 1.14
17
+
18
+ @import '../settings/visuallyhidden';
19
+
20
+ .#{$bitstyles-namespace}o-visuallyhidden {
21
+ @include visuallyhidden;
22
+ }
23
+
24
+ @each $breakpoint in $visuallyhidden-breakpoints {
25
+ @include media-query($breakpoint) {
26
+ .#{$bitstyles-namespace}o-visuallyhidden\@#{$breakpoint} {
27
+ @include visuallyhidden;
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,3 @@
1
+ $bitstyles-bordered-header-line-min-width: 20% !default;
2
+ $bitstyles-bordered-header-gutter: 1em !default;
3
+ $bitstyles-bordered-header-border: 1px solid $bitstyles-color-gray-20 !default;
@@ -0,0 +1,5 @@
1
+ $bitstyles-button-icon-padding: 1rem !default;
2
+ $bitstyles-button-icon-color: $bitstyles-color-white !default;
3
+ $bitstyles-button-icon-background-color: $bitstyles-color-black !default;
4
+ $bitstyles-button-icon-border: 0 !default;
5
+ $bitstyles-button-icon-border-radius: $bitstyles-border-radius-round !default;
@@ -0,0 +1,18 @@
1
+ $bitstyles-button-padding-vertical: 0.6rem !default;
2
+ $bitstyles-button-padding-horizontal: 1.5rem !default;
3
+
4
+ $bitstyles-button-background-color: $bitstyles-color-black !default;
5
+ $bitstyles-button-color: $bitstyles-color-white !default;
6
+ $bitstyles-button-background-color-hover: $bitstyles-color-white !default;
7
+ $bitstyles-button-color-hover: $bitstyles-color-black !default;
8
+
9
+ $bitstyles-button-background-color-disabled: $bitstyles-color-gray-30 !default;
10
+ $bitstyles-button-border-color-disabled: $bitstyles-color-gray-30 !default;
11
+ $bitstyles-button-color-disabled: $bitstyles-color-gray-70 !default;
12
+
13
+ $bitstyles-button-border: 1px solid !default;
14
+ $bitstyles-button-border-radius: 0.25rem !default;
15
+
16
+ $bitstyles-button-transition: color $bitstyles-transition-duration $bitstyles-transition-easing, background-color $bitstyles-transition-duration $bitstyles-transition-easing !default;
17
+
18
+ $bitstyles-button-icon-spacing: $bitstyles-spacing-horizontal / 2 !default;
@@ -0,0 +1,5 @@
1
+ $bitstyles-content-max-width: 45rem !default;
2
+ $bitstyles-content-horizontal-padding: $bitstyles-spacing !default;
3
+
4
+ $bitstyles-content-horizontal-padding-large: $bitstyles-spacing * 2 !default;
5
+ $bitstyles-content-large-breakpoint: 'large' !default; // The breakpoint at which we implement the above horizontal-padding value.
@@ -0,0 +1,3 @@
1
+ $bitstyles-transition-easing: ease-in-out !default;
2
+ $bitstyles-transition-duration: 0.15s !default;
3
+ $bitstyles-transition-duration-long: 0.5s !default;
@@ -0,0 +1,12 @@
1
+ $bitstyles-breakpoint-boundary-width: 0.0625em !default;
2
+ $bitstyles-breakpoint-small-medium-boundary: 45em !default;
3
+ $bitstyles-breakpoint-medium-large-boundary: 64em !default;
4
+
5
+ $bitstyles-breakpoints: (
6
+ 'small': 'screen and (max-width: #{$bitstyles-breakpoint-small-medium-boundary - $bitstyles-breakpoint-boundary-width})',
7
+ 'medium': 'screen and (min-width: #{$bitstyles-breakpoint-small-medium-boundary}) and (max-width: #{$bitstyles-breakpoint-medium-large-boundary - $bitstyles-breakpoint-boundary-width})',
8
+ 'medium-and-up': 'screen and (min-width: #{$bitstyles-breakpoint-small-medium-boundary})',
9
+ 'small-and-medium': 'screen and (max-width: #{$bitstyles-breakpoint-medium-large-boundary - $bitstyles-breakpoint-boundary-width})',
10
+ 'large': 'screen and (min-width: #{$bitstyles-breakpoint-medium-large-boundary})',
11
+ 'hidpi': '(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi), (min-resolution: 2dppx)'
12
+ ) !default;
@@ -0,0 +1,14 @@
1
+ // Monochrome
2
+ $bitstyles-color-black: #000 !default;
3
+ $bitstyles-color-white: #fff !default;
4
+
5
+ // Greys
6
+ $bitstyles-color-gray-10: #e5e5e5 !default;
7
+ $bitstyles-color-gray-20: #ccc !default;
8
+ $bitstyles-color-gray-30: #b2b2b2 !default;
9
+ $bitstyles-color-gray-40: #999 !default;
10
+ $bitstyles-color-gray-50: #7f7f7f !default;
11
+ $bitstyles-color-gray-60: #666 !default;
12
+ $bitstyles-color-gray-70: #4c4c4c !default;
13
+ $bitstyles-color-gray-80: #333 !default;
14
+ $bitstyles-color-gray-90: #191919 !default;
@@ -0,0 +1,11 @@
1
+ $bitstyles-colors-theme: (
2
+ 'primary': $bitstyles-color-gray-70,
3
+ 'secondary': $bitstyles-color-gray-20,
4
+ 'text': $bitstyles-color-gray-80,
5
+ 'background': $bitstyles-color-white,
6
+ 'positive': #0f0,
7
+ 'error': #f00
8
+ ) !default;
9
+
10
+ $foreground-colors: ('primary', 'secondary', 'error');
11
+ $background-colors: ('background', 'secondary');
@@ -0,0 +1,7 @@
1
+ $bitstyles-spacing: 1rem !default;
2
+ $bitstyles-spacing-vertical: $bitstyles-spacing !default;
3
+ $bitstyles-spacing-horizontal: $bitstyles-spacing !default;
4
+
5
+ $bitstyles-global-z: topbar !default;
6
+
7
+ $bitstyles-border-radius-round: 9999rem !default;
@@ -0,0 +1 @@
1
+ $bitstyles-namespace: null !default; // Defining a namespace will prepend it to every selector name
@@ -0,0 +1,28 @@
1
+ $bitstyles-font-family-header: serif !default;
2
+ $bitstyles-font-family-header-loaded: serif !default;
3
+ $bitstyles-font-family-body: helvetica, sans-serif !default;
4
+ $bitstyles-font-family-body-loaded: helvetica, sans-serif !default;
5
+
6
+ $bitstyles-font-weight-light: 300 !default;
7
+ $bitstyles-font-weight-normal: 400 !default;
8
+ $bitstyles-font-weight-bold: 700 !default;
9
+
10
+ $bitstyles-typography-breakpoint: medium-and-up !default;
11
+
12
+ $bitstyles-font-size-base-small: 16px !default;
13
+ $bitstyles-font-size-h0-small: 32px !default;
14
+ $bitstyles-font-size-h1-small: 24px !default;
15
+ $bitstyles-font-size-h2-small: 20px !default;
16
+ $bitstyles-font-size-h3-small: 18px !default;
17
+ $bitstyles-font-size-h4-small: $bitstyles-font-size-base-small !default;
18
+ $bitstyles-font-size-h5-small: $bitstyles-font-size-base-small !default;
19
+ $bitstyles-font-size-h6-small: $bitstyles-font-size-base-small !default;
20
+
21
+ $bitstyles-font-size-base: 18px !default;
22
+ $bitstyles-font-size-h0: 86px !default;
23
+ $bitstyles-font-size-h1: 40px !default;
24
+ $bitstyles-font-size-h2: 28px !default;
25
+ $bitstyles-font-size-h3: 20px !default;
26
+ $bitstyles-font-size-h4: $bitstyles-font-size-base !default;
27
+ $bitstyles-font-size-h5: $bitstyles-font-size-base !default;
28
+ $bitstyles-font-size-h6: $bitstyles-font-size-base !default;
@@ -0,0 +1 @@
1
+ $bitstyles-grid-gutter: $bitstyles-spacing-horizontal !default;
@@ -0,0 +1 @@
1
+ $hidden-breakpoints: (small, large) !default;
@@ -0,0 +1,5 @@
1
+ $bitstyles-icon-sizes: (
2
+ 'small' 1rem,
3
+ 'medium' 2rem,
4
+ 'large' 3rem
5
+ ) !default;
@@ -0,0 +1,12 @@
1
+ $bitstyles-input-color: map-get($bitstyles-colors-theme, 'text') !default;
2
+ $bitstyles-input-padding: $bitstyles-spacing / 2 !default;
3
+ $bitstyles-input-border: 1px solid $bitstyles-color-gray-30 !default;
4
+ $bitstyles-input-border-radius: 5px !default;
5
+ $bitstyles-input-border-active: 1px solid $bitstyles-color-gray-50 !default;
6
+ $bitstyles-input-background: $bitstyles-color-white !default;
7
+ $bitstyles-input-placeholder-color: $bitstyles-color-gray-50 !default;
8
+
9
+ $bitstyles-input-background-color-disabled: $bitstyles-color-gray-10 !default;
10
+ $bitstyles-input-color-disabled: map-get($bitstyles-colors-theme, 'text') !default;
11
+
12
+ $bitstyles-input-checkbox-size: 1rem;
@@ -0,0 +1,4 @@
1
+ $bitstyles-color-link: $bitstyles-color-gray-50 !default;
2
+ $bitstyles-color-link-visited: $bitstyles-color-gray-70 !default;
3
+ $bitstyles-color-link-hover: $bitstyles-color-gray-20 !default;
4
+ $bitstyles-link-transition: color $bitstyles-transition-duration $bitstyles-transition-easing !default;
@@ -0,0 +1,9 @@
1
+ $bitstyles-modal-background-color: #d9d9d9 !default;
2
+ $bitstyles-modal-overlay-color: rgba($bitstyles-color-black, 0.7) !default;
3
+ $bitstyles-modal-transition-easing: ease-in-out !default;
4
+ $bitstyles-modal-transition-duration: 0.3s !default;
5
+ $bitstyles-modal-transition-duration-smallscreen: 0.25s !default;
6
+ $bitstyles-modal-transition-delay: 0.05s !default;
7
+ $bitstyles-modal-will-change: opacity, transform, visibility !default;
8
+ $bitstyles-modal-border-radius: 0 !default;
9
+ $bitstyles-modal-breakpoint: medium-and-up !default;
@@ -0,0 +1,2 @@
1
+ $bitstyles-topbar-vertical-padding: $bitstyles-spacing !default;
2
+ $bitstyles-topbar-horizontal-padding: $bitstyles-spacing * 2 !default;
@@ -0,0 +1 @@
1
+ $visuallyhidden-breakpoints: () !default;
@@ -0,0 +1,12 @@
1
+ // These column variables can be lists — (10, 12) will give multiple grid systems: every permutation of 10 columns
2
+ // (1/10, 2/10, 3/10… 9/10, 10/10) and 12 columns (1/12, 2/12, 3/12… 11/12, 12/12).
3
+ // We normally only need one grid system (i.e. one set of columns).
4
+ $bitstyles-widths: (12) !default;
5
+
6
+ // If a breakpoint is defined here and the name matches one defined in
7
+ // settings/layout, layout/widths will generate a grid layout for that
8
+ // breakpoint.
9
+ // If this is empty, no responsive breakpoints will be generated.
10
+ $bitstyles-widths-breakpoints: (
11
+ 'medium-and-up'
12
+ ) !default;
@@ -0,0 +1,13 @@
1
+ // Absolute Center
2
+ //
3
+ // Vertically & horizontally centred element.
4
+ // Absolutely positioned, so centred relative to nearest relatively-positioned parent.
5
+ //
6
+ // Styleguide 2.1
7
+
8
+ @mixin absolute-center {
9
+ position: absolute;
10
+ top: 50%;
11
+ left: 50%;
12
+ transform: translate(-50%, -50%);
13
+ }
@@ -0,0 +1,13 @@
1
+ // Absolute Cover
2
+ //
3
+ // An element that covers its nearest relatively-positioned parent from edge to edge.
4
+ //
5
+ // Styleguide 2.2
6
+
7
+ @mixin absolute-cover($distance: 0) {
8
+ position: absolute;
9
+ top: $distance;
10
+ right: $distance;
11
+ bottom: $distance;
12
+ left: $distance;
13
+ }
@@ -0,0 +1,9 @@
1
+ // Block
2
+ //
3
+ // Display an element as a block.
4
+ //
5
+ // Styleguide 2.16
6
+
7
+ @mixin block {
8
+ display: block;
9
+ }
@@ -0,0 +1,11 @@
1
+ // Break long words
2
+ //
3
+ // Forces text content within an element to break if longer than the element is wide.
4
+ //
5
+ // Styleguide 2.3
6
+
7
+ @mixin break-long-words {
8
+ overflow-wrap: break-word;
9
+ word-break: break-word; // all 3 are required for cross-browser reasonablness. Without, some browsers force-break *everything*
10
+ word-wrap: break-word;
11
+ }
@@ -0,0 +1,13 @@
1
+ // Clearfix
2
+ //
3
+ // Apply to a floated element (or its parent) to ensure following elements are cleared.
4
+ //
5
+ // Styleguide 2.4
6
+
7
+ @mixin clearfix {
8
+ &::after {
9
+ display: table;
10
+ clear: both;
11
+ content: '';
12
+ }
13
+ }
@@ -0,0 +1,27 @@
1
+ // Fixed Ratio
2
+ //
3
+ // An element that has intrinsic shape — width will be 100%, height will be limited to keep 16:9 aspect ratio.
4
+ //
5
+ // Styleguide 2.5
6
+
7
+ @mixin fixed-ratio {
8
+ position: relative;
9
+ display: block;
10
+ width: 100%;
11
+ overflow: hidden;
12
+
13
+ &::before {
14
+ display: block;
15
+ padding-top: 56.25%;
16
+ content: '';
17
+ }
18
+ }
19
+
20
+ @mixin fixed-ratio__inner {
21
+ @include absolute-cover;
22
+
23
+ display: block;
24
+ width: 100%;
25
+ height: auto;
26
+ min-height: 100%;
27
+ }
@@ -0,0 +1,15 @@
1
+ // Flex
2
+ //
3
+ // Simple flex layout.
4
+ // Make one of the children `.o-flex__primary` to make it take as much space as is available.
5
+ //
6
+ // Styleguide 2.17
7
+
8
+ @mixin flex {
9
+ display: flex;
10
+ align-items: stretch;
11
+ }
12
+
13
+ @mixin flex__primary {
14
+ flex: 1 0 auto;
15
+ }
@@ -0,0 +1,21 @@
1
+ // Webfont
2
+ //
3
+ // Helper mixin to output a widely cross-browser-compatible `@font-face` declaration.
4
+ //
5
+ // ```@include webfont(Roboto, italic, 700, 'fonts/roboto-bold-italic');```
6
+ //
7
+ // Styleguide 2.15
8
+
9
+ @mixin webfont($font-family, $font-style, $font-weight, $font-url) {
10
+ @font-face {
11
+ font-family: $font-family;
12
+ font-style: $font-style;
13
+ font-weight: $font-weight;
14
+ src: font-url('#{$font-url}.eot');
15
+ src:
16
+ font-url('#{$font-url}.eot?#iefix') format('embedded-opentype'),
17
+ font-url('#{$font-url}.woff2') format('woff2'),
18
+ font-url('#{$font-url}.woff') format('woff'),
19
+ font-url('#{$font-url}.ttf') format('truetype');
20
+ }
21
+ }
@@ -0,0 +1,11 @@
1
+ // Hidden
2
+ //
3
+ // Fully hides an element & its children — does not affect document flow, does not get read by google or screenreaders.
4
+ //
5
+ // Styleguide 2.6
6
+
7
+ @mixin hidden {
8
+ /* stylelint-disable declaration-no-important */
9
+ display: none !important;
10
+ /* stylelint-enable declaration-no-important */
11
+ }
@@ -0,0 +1,17 @@
1
+ // List reset
2
+ //
3
+ // Removes the default bullet points from a list, along with any margins and
4
+ // padding.
5
+ //
6
+ // Optional parameters to prevent removal of margins and padding.
7
+ //
8
+ // Styleguide 2.13
9
+
10
+ @mixin list-reset($spacing: true) {
11
+ @if $spacing {
12
+ padding: 0;
13
+ margin: 0;
14
+ }
15
+
16
+ list-style-type: none;
17
+ }
@@ -0,0 +1,30 @@
1
+ // Media Query
2
+ //
3
+ // Helper function to ease usage of media-queries. Uses the breakpoints listed in $breakpoint sass variable.
4
+ //
5
+ // Usage:
6
+ //
7
+ // `
8
+ // @media-query(breakpoint-name) {
9
+ // .selector {
10
+ // …styles here…
11
+ // }
12
+ // }
13
+ // `
14
+ //
15
+ // Styleguide 2.11
16
+
17
+ @mixin media-query($mq, $breakpoints: $bitstyles-breakpoints) {
18
+
19
+ $breakpoint-condition: map-get($breakpoints, $mq);
20
+
21
+ @if ($breakpoint-condition) {
22
+ @media #{$breakpoint-condition} {
23
+ @content;
24
+ }
25
+ }
26
+
27
+ @else {
28
+ @error "Oops! Breakpoint ‘#{$mq}’ does not exist.";
29
+ }
30
+ }
@@ -0,0 +1,15 @@
1
+ // Media
2
+ //
3
+ // Nicole Sullivan’s OOCSS media object.
4
+ //
5
+ // Styleguide 2.18
6
+
7
+ @mixin media {
8
+ display: block;
9
+ overflow: hidden;
10
+ }
11
+
12
+ @mixin media__feature {
13
+ float: left;
14
+ margin-right: $bitstyles-spacing;
15
+ }
@@ -0,0 +1,13 @@
1
+ // Truncate with ellipsis(…)
2
+ //
3
+ // If an element is single-line inline or inline-block, this will truncate its content
4
+ // and display an ellipsis (…) at the end of the line.
5
+ //
6
+ // Styleguide 2.9
7
+
8
+ @mixin truncate-with-ellipsis($truncation-boundary: 100%) {
9
+ max-width: $truncation-boundary;
10
+ overflow: hidden;
11
+ text-overflow: ellipsis;
12
+ white-space: nowrap;
13
+ }
@@ -0,0 +1,18 @@
1
+ // Px to Rem sizing
2
+ //
3
+ // Converts pixels to rems — use to define font-sizes etc.
4
+ //
5
+ // Styleguide 2.12.1
6
+
7
+ @function px-to-rem($pixel-size, $root-size: $bitstyles-font-size-base-small) {
8
+ @return ($pixel-size / $root-size) * 1rem;
9
+ }
10
+
11
+ // em sizing
12
+ //
13
+ // Converts pixels to ems — use to define font-sizes etc.
14
+ //
15
+ // Styleguide 2.12.2
16
+ @function px-to-em($pixels, $browser-context: $bitstyles-font-size-base-small) {
17
+ @return ($pixels / $browser-context) + 0em; // stylelint-disable-line length-zero-no-unit
18
+ }
@@ -0,0 +1,17 @@
1
+ @mixin generic-heading {
2
+ margin: 0 0 $bitstyles-spacing;
3
+ font-family: $bitstyles-font-family-header;
4
+ font-weight: $bitstyles-font-weight-bold;
5
+ text-rendering: optimizeLegibility;
6
+
7
+ .fonts-loaded & {
8
+ font-family: $bitstyles-font-family-header-loaded;
9
+ }
10
+ }
11
+
12
+ @mixin font-size($pixel-size, $browser-context: $bitstyles-font-size-base-small) {
13
+ /* stylelint-disable declaration-block-no-duplicate-properties */
14
+ font-size: $pixel-size;
15
+ font-size: px-to-rem($pixel-size, $browser-context);
16
+ /* stylelint-enable declaration-block-no-duplicate-properties */
17
+ }
@@ -0,0 +1,11 @@
1
+ // Vertical Center
2
+ //
3
+ // Vertically centres an element relative to its parent.
4
+ //
5
+ // Styleguide 2.8
6
+
7
+ @mixin vertical-center {
8
+ position: absolute;
9
+ top: 50%;
10
+ transform: translateY(-50%);
11
+ }
@@ -0,0 +1,18 @@
1
+ // Visuallyhidden
2
+ //
3
+ // Hides an element, but leaves it still readable by screenreaders & google.
4
+ //
5
+ // Styleguide 2.7
6
+
7
+ @mixin visuallyhidden {
8
+ /* stylelint-disable declaration-no-important */
9
+ position: absolute !important;
10
+ /* stylelint-enable declaration-no-important */
11
+ width: 1px;
12
+ height: 1px;
13
+ padding: 0;
14
+ margin: -1px;
15
+ overflow: hidden;
16
+ clip: rect(0 0 0 0);
17
+ border: 0;
18
+ }