@papillonbits/css 0.1.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 (33) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/build/index.scss +1 -0
  4. package/build/primer/base/base.scss +89 -0
  5. package/build/primer/base/index.scss +6 -0
  6. package/build/primer/base/kbd.scss +23 -0
  7. package/build/primer/base/normalize.scss +421 -0
  8. package/build/primer/base/octicons.scss +6 -0
  9. package/build/primer/base/typography-base.scss +92 -0
  10. package/build/primer/index.scss +6 -0
  11. package/build/primer/support/index.scss +10 -0
  12. package/build/primer/support/mixins/color-modes.scss +109 -0
  13. package/build/primer/support/mixins/layout.scss +60 -0
  14. package/build/primer/support/mixins/misc.scss +27 -0
  15. package/build/primer/support/mixins/typography.scss +87 -0
  16. package/build/primer/support/variables/layout.scss +201 -0
  17. package/build/primer/support/variables/misc.scss +17 -0
  18. package/build/primer/support/variables/typography.scss +43 -0
  19. package/build/primer/truncate/index.scss +2 -0
  20. package/build/primer/truncate/truncate.scss +61 -0
  21. package/build/primer/utilities/animations.scss +196 -0
  22. package/build/primer/utilities/borders.scss +79 -0
  23. package/build/primer/utilities/box-shadow.scss +27 -0
  24. package/build/primer/utilities/colors.scss +95 -0
  25. package/build/primer/utilities/details.scss +28 -0
  26. package/build/primer/utilities/flexbox.scss +54 -0
  27. package/build/primer/utilities/index.scss +14 -0
  28. package/build/primer/utilities/layout.scss +98 -0
  29. package/build/primer/utilities/margin.scss +74 -0
  30. package/build/primer/utilities/padding.scss +59 -0
  31. package/build/primer/utilities/typography.scss +248 -0
  32. package/build/primer/utilities/visibility-display.scss +125 -0
  33. package/package.json +27 -0
@@ -0,0 +1,59 @@
1
+ @import "../support/variables/layout.scss";
2
+ @import "../support/mixins/layout.scss";
3
+
4
+ // Padding spacer utilities
5
+ // stylelint-disable block-opening-brace-space-before
6
+ // stylelint-disable comment-empty-line-before
7
+ // stylelint-disable primer/spacing
8
+
9
+ // Responsive padding spacer utilities
10
+ @each $breakpoint, $variant in $responsive-variants {
11
+ @include breakpoint($breakpoint) {
12
+ // Loop through the spacer values
13
+ @each $scale, $size in $spacer-map-extended {
14
+ @if ($scale < length($spacer-map)) {
15
+ /* Set a $size padding to all sides at $breakpoint */
16
+ .p#{$variant}-#{$scale} { padding: $size !important; }
17
+ }
18
+
19
+ /* Set a $size padding to the top at $breakpoint */
20
+ .pt#{$variant}-#{$scale} { padding-top: $size !important; }
21
+ /* Set a $size padding to the right at $breakpoint */
22
+ .pr#{$variant}-#{$scale} { padding-right: $size !important; }
23
+ /* Set a $size padding to the bottom at $breakpoint */
24
+ .pb#{$variant}-#{$scale} { padding-bottom: $size !important; }
25
+ /* Set a $size padding to the left at $breakpoint */
26
+ .pl#{$variant}-#{$scale} { padding-left: $size !important; }
27
+
28
+ @if ($scale < length($spacer-map)) {
29
+ /* Set a $size padding to the left & right at $breakpoint */
30
+ .px#{$variant}-#{$scale} {
31
+ padding-right: $size !important;
32
+ padding-left: $size !important;
33
+ }
34
+ }
35
+
36
+ /* Set a $size padding to the top & bottom at $breakpoint */
37
+ .py#{$variant}-#{$scale} {
38
+ padding-top: $size !important;
39
+ padding-bottom: $size !important;
40
+ }
41
+ }
42
+ }
43
+ }
44
+
45
+ // responsive padding for containers
46
+ .p-responsive {
47
+ padding-right: $spacer-3 !important;
48
+ padding-left: $spacer-3 !important;
49
+
50
+ @include breakpoint(sm) {
51
+ padding-right: $spacer-6 !important;
52
+ padding-left: $spacer-6 !important;
53
+ }
54
+
55
+ @include breakpoint(lg) {
56
+ padding-right: $spacer-3 !important;
57
+ padding-left: $spacer-3 !important;
58
+ }
59
+ }
@@ -0,0 +1,248 @@
1
+ @import "../support/variables/typography.scss";
2
+ @import "../support/mixins/layout.scss";
3
+
4
+ // stylelint-disable comment-empty-line-before
5
+
6
+ // Type scale variables found in ../support/lib/variables.scss
7
+ // $h00-size-mobile: 40px;
8
+ // $h0-size-mobile: 32px;
9
+ // $h1-size-mobile: 26px;
10
+ // $h2-size-mobile: 22px;
11
+ // $h3-size-mobile: 18px;
12
+ // $h00-size: 48px;
13
+ // $h0-size: 40px;
14
+ // $h1-size: 32px;
15
+ // $h2-size: 24px;
16
+ // $h3-size: 20px;
17
+ // $h4-size: 16px;
18
+ // $h5-size: 14px;
19
+ // $h6-size: 12px;
20
+
21
+ /* Set the font size to 26px */
22
+ .h1 {
23
+ // stylelint-disable-next-line primer/typography
24
+ font-size: $h1-size-mobile !important;
25
+
26
+ @include breakpoint(md) { font-size: $h1-size !important; }
27
+ }
28
+
29
+ /* Set the font size to 22px */
30
+ .h2 {
31
+ // stylelint-disable-next-line primer/typography
32
+ font-size: $h2-size-mobile !important;
33
+
34
+ @include breakpoint(md) { font-size: $h2-size !important; }
35
+ }
36
+
37
+ /* Set the font size to 18px */
38
+ .h3 {
39
+ // stylelint-disable-next-line primer/typography
40
+ font-size: $h3-size-mobile !important;
41
+
42
+ @include breakpoint(md) { font-size: $h3-size !important; }
43
+ }
44
+
45
+ /* Set the font size to #{$h4-size} */
46
+ .h4 {
47
+ font-size: $h4-size !important;
48
+ }
49
+
50
+ /* Set the font size to #{$h5-size} */
51
+ .h5 { font-size: $h5-size !important; }
52
+
53
+ // Does not include color property like typography base
54
+ // styles, color should be applied with color utilities.
55
+ /* Set the font size to #{$h6-size} */
56
+ .h6 { font-size: $h6-size !important; }
57
+
58
+ // Heading utilities
59
+ .h1,
60
+ .h2,
61
+ .h3,
62
+ .h4,
63
+ .h5,
64
+ .h6 { font-weight: $font-weight-bold !important; }
65
+
66
+ // Type utilities that match type sale
67
+ /* Set the font size to 26px */
68
+ .f1 {
69
+ // stylelint-disable-next-line primer/typography
70
+ font-size: $h1-size-mobile !important;
71
+
72
+ @include breakpoint(md) { font-size: $h1-size !important; }
73
+ }
74
+
75
+ /* Set the font size to 22px */
76
+ .f2 {
77
+ // stylelint-disable-next-line primer/typography
78
+ font-size: $h2-size-mobile !important;
79
+
80
+ @include breakpoint(md) { font-size: $h2-size !important; }
81
+ }
82
+
83
+ /* Set the font size to 18px */
84
+ .f3 {
85
+ // stylelint-disable-next-line primer/typography
86
+ font-size: $h3-size-mobile !important;
87
+
88
+ @include breakpoint(md) { font-size: $h3-size !important; }
89
+ }
90
+
91
+ /* Set the font size to #{$h4-size} */
92
+ .f4 {
93
+ font-size: $h4-size !important;
94
+
95
+ @include breakpoint(md) { font-size: $h4-size !important; }
96
+ }
97
+
98
+ /* Set the font size to #{$h5-size} */
99
+ .f5 { font-size: $h5-size !important; }
100
+ /* Set the font size to #{$h6-size} */
101
+ .f6 { font-size: $h6-size !important; }
102
+
103
+ // Type utils with light weight that match type scale
104
+ /* Set the font size to 40px and weight to light */
105
+ .f00-light {
106
+ // stylelint-disable-next-line primer/typography
107
+ font-size: $h00-size-mobile !important;
108
+ font-weight: $font-weight-light !important;
109
+
110
+ @include breakpoint(md) { font-size: $h00-size !important; }
111
+ }
112
+
113
+ /* Set the font size to 32px and weight to light */
114
+ .f0-light {
115
+ // stylelint-disable-next-line primer/typography
116
+ font-size: $h0-size-mobile !important;
117
+ font-weight: $font-weight-light !important;
118
+
119
+ @include breakpoint(md) { font-size: $h0-size !important; }
120
+ }
121
+
122
+ /* Set the font size to 26px and weight to light */
123
+ .f1-light {
124
+ // stylelint-disable-next-line primer/typography
125
+ font-size: $h1-size-mobile !important;
126
+ font-weight: $font-weight-light !important;
127
+
128
+ @include breakpoint(md) { font-size: $h1-size !important; }
129
+ }
130
+
131
+ /* Set the font size to 22px and weight to light */
132
+ .f2-light {
133
+ // stylelint-disable-next-line primer/typography
134
+ font-size: $h2-size-mobile !important;
135
+ font-weight: $font-weight-light !important;
136
+
137
+ @include breakpoint(md) { font-size: $h2-size !important; }
138
+ }
139
+
140
+ // Same size and weight as .lead but without color property
141
+ /* Set the font size to 18px and weight to light */
142
+ .f3-light {
143
+ // stylelint-disable-next-line primer/typography
144
+ font-size: $h3-size-mobile !important;
145
+ font-weight: $font-weight-light !important;
146
+
147
+ @include breakpoint(md) { font-size: $h3-size !important; }
148
+ }
149
+
150
+ // Smallest text size
151
+ /* Set the font size to ${#h6-size} */
152
+ .text-small { font-size: $h6-size !important; } // 12px
153
+
154
+ /* Large leading paragraphs */
155
+ .lead {
156
+ // stylelint-disable-next-line primer/spacing
157
+ margin-bottom: 30px;
158
+ font-size: $h3-size;
159
+ font-weight: $font-weight-light;
160
+ }
161
+
162
+ // Line-height variations
163
+ // Close to commonly used line-heights. Most line-heights
164
+ // combined with type size equate to whole pixels.
165
+ // Will be improved with future typography scale updates.
166
+ // Responsive line-height
167
+ @each $breakpoint, $variant in $responsive-variants {
168
+ @include breakpoint($breakpoint) {
169
+ /* Set the line height to ultra condensed */
170
+ .lh#{$variant}-condensed-ultra { line-height: $lh-condensed-ultra !important; }
171
+ /* Set the line height to condensed */
172
+ .lh#{$variant}-condensed { line-height: $lh-condensed !important; }
173
+ /* Set the line height to default */
174
+ .lh#{$variant}-default { line-height: $lh-default !important; }
175
+ /* Set the line height to zero */
176
+ .lh#{$variant}-0 { line-height: 0 !important; }
177
+ }
178
+ }
179
+
180
+ // Text alignments
181
+ // Responsive text alignment
182
+ @each $breakpoint, $variant in $responsive-variants {
183
+ @include breakpoint($breakpoint) {
184
+ /* Text align to the right */
185
+ .text#{$variant}-right { text-align: right !important; }
186
+ /* Text align to the left */
187
+ .text#{$variant}-left { text-align: left !important; }
188
+ /* Text align to the center */
189
+ .text#{$variant}-center { text-align: center !important; }
190
+ }
191
+ }
192
+
193
+ // Text styles
194
+ /* Set the font weight to normal */
195
+ .text-normal { font-weight: $font-weight-normal !important; }
196
+ /* Set the font weight to bold */
197
+ .text-bold { font-weight: $font-weight-bold !important; }
198
+ .text-semibold { font-weight: $font-weight-semibold !important; }
199
+ .text-light { font-weight: $font-weight-light !important; }
200
+ /* Set the font to italic */
201
+ .text-italic { font-style: italic !important; }
202
+ /* Make text uppercase */
203
+ .text-uppercase { text-transform: uppercase !important; }
204
+ /* Underline text */
205
+ .text-underline { text-decoration: underline !important; }
206
+ /* Don't underline text */
207
+ .no-underline { text-decoration: none !important; }
208
+ /* Don't wrap white space */
209
+ .no-wrap { white-space: nowrap !important; }
210
+ /* Normal white space */
211
+ .ws-normal { white-space: normal !important; }
212
+
213
+ /* Force long "words" to wrap if they exceed the width of the container */
214
+ .wb-break-word {
215
+ word-break: break-word !important;
216
+ // this is for backwards compatibility with browsers that don't respect overflow-wrap
217
+ word-wrap: break-word !important;
218
+ overflow-wrap: break-word !important;
219
+ }
220
+
221
+ /*
222
+ * Specifically apply word-break: break-all; per MDN:
223
+ *
224
+ * > Note: In contrast to `word-break: break-word` and `overflow-wrap: break-word`,
225
+ * > `word-break: break-all` will create a break at the exact place where text would
226
+ * > otherwise overflow its container (even if putting an entire word on its own line
227
+ * > would negate the need for a break).
228
+ *
229
+ * see: https://developer.mozilla.org/en-US/docs/Web/CSS/word-break#Values
230
+ */
231
+ .wb-break-all { word-break: break-all !important; }
232
+
233
+ .text-emphasized {
234
+ font-weight: $font-weight-bold;
235
+ }
236
+
237
+ // List styles
238
+ .list-style-none { list-style: none !important; }
239
+
240
+ /* Set to monospace font */
241
+ .text-mono {
242
+ font-family: $mono-font !important;
243
+ }
244
+
245
+ /* Disallow user from selecting text */
246
+ .user-select-none {
247
+ user-select: none !important;
248
+ }
@@ -0,0 +1,125 @@
1
+ @import "../support/mixins/layout.scss";
2
+
3
+ // Visibility and display utilities
4
+
5
+ // Responsive display utilities
6
+ @each $breakpoint, $variant in $responsive-variants {
7
+ @include breakpoint($breakpoint) {
8
+ @each $display in $display-values {
9
+ .d#{$variant}-#{$display} { display: $display !important; }
10
+ }
11
+ }
12
+ }
13
+
14
+ .v-hidden { visibility: hidden !important; }
15
+ .v-visible { visibility: visible !important; }
16
+
17
+ // Hide utilities for each breakpoint
18
+ // Each hide utility only applies to one breakpoint range.
19
+ @media (max-width: $width-sm - 0.02px) {
20
+ .hide-sm {
21
+ display: none !important;
22
+ }
23
+ }
24
+
25
+ @media (min-width: $width-sm) and (max-width: $width-md - 0.02px) {
26
+ .hide-md {
27
+ display: none !important;
28
+ }
29
+ }
30
+
31
+ @media (min-width: $width-md) and (max-width: $width-lg - 0.02px) {
32
+ .hide-lg {
33
+ display: none !important;
34
+ }
35
+ }
36
+
37
+ @media (min-width: $width-lg) {
38
+ .hide-xl {
39
+ display: none !important;
40
+ }
41
+ }
42
+
43
+ // Show/Hide Viewport range utilities
44
+
45
+ .show-whenNarrow,
46
+ .show-whenRegular,
47
+ .show-whenWide,
48
+ .show-whenRegular.hide-whenWide {
49
+ display: none !important;
50
+ }
51
+
52
+ .hide-whenNarrow,
53
+ .hide-whenRegular,
54
+ .hide-whenWide {
55
+ display: block !important;
56
+ }
57
+
58
+ @media (max-width: $width-md - 0.02px) {
59
+ .show-whenNarrow {
60
+ display: block !important;
61
+ }
62
+
63
+ .hide-whenNarrow {
64
+ display: none !important;
65
+ }
66
+ }
67
+
68
+ @media (min-width: $width-md) {
69
+ .show-whenRegular,
70
+ .show-whenRegular.hide-whenWide {
71
+ display: block !important;
72
+ }
73
+
74
+ .hide-whenRegular {
75
+ display: none !important;
76
+ }
77
+ }
78
+
79
+ // The width of a `wide` viewport range may change as we're finalizing
80
+ // the Primer primitives viewport ranges proposal
81
+ @media (min-width: $width-xl) {
82
+ .show-whenWide {
83
+ display: block !important;
84
+ }
85
+
86
+ .hide-whenWide,
87
+ .show-whenRegular.hide-whenWide {
88
+ display: none !important;
89
+ }
90
+ }
91
+
92
+ /* Set the table-layout to fixed */
93
+ .table-fixed { table-layout: fixed !important; }
94
+
95
+ // Only display content to screen readers
96
+ //
97
+ // See: http://a11yproject.com/posts/how-to-hide-content/
98
+ .sr-only {
99
+ position: absolute;
100
+ width: 1px;
101
+ height: 1px;
102
+ padding: 0;
103
+ overflow: hidden;
104
+ clip: rect(0, 0, 0, 0);
105
+ // Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1241631
106
+ word-wrap: normal;
107
+ border: 0;
108
+ }
109
+
110
+ // Only display content on focus
111
+ .show-on-focus {
112
+ position: absolute;
113
+ width: 1px;
114
+ height: 1px;
115
+ margin: 0;
116
+ overflow: hidden;
117
+ clip: rect(1px, 1px, 1px, 1px);
118
+
119
+ &:focus {
120
+ z-index: 20;
121
+ width: auto;
122
+ height: auto;
123
+ clip: auto;
124
+ }
125
+ }
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@papillonbits/css",
3
+ "version": "0.1.0",
4
+ "description": "Papillon Bits CSS",
5
+ "homepage": "https://github.com/papillonbits/papillonbits/tree/master/packages/css",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/papillonbits/papillonbits.git",
9
+ "directory": "packages/css"
10
+ },
11
+ "main": "build/index.scss",
12
+ "module": "src/index.js",
13
+ "files": [
14
+ "build",
15
+ "README.md"
16
+ ],
17
+ "scripts": {
18
+ "clean-up": "rm -rf build node_modules package-lock.json",
19
+ "install-packages": "npm install",
20
+ "install-papillonbits-latest": "echo \"css skipping install-papillonbits-latest\" && exit 0",
21
+ "build": "rm -rf build && babel --copy-files --no-copy-ignored --out-dir build src",
22
+ "build-test": "npm run build",
23
+ "build-acceptance": "npm run build",
24
+ "build-release": "npm run build"
25
+ },
26
+ "gitHead": "d1d69160a726db6045ba81b79c29ba9d00e2b631"
27
+ }