pico-rails 1.4.4

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 (41) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +53 -0
  3. data/app/assets/stylesheets/pico.classless.scss +13 -0
  4. data/app/assets/stylesheets/pico.fluid.classless.scss +16 -0
  5. data/app/assets/stylesheets/pico.scss +42 -0
  6. data/app/assets/stylesheets/pico.slim.scss +47 -0
  7. data/app/assets/stylesheets/scss/_variables.scss +66 -0
  8. data/app/assets/stylesheets/scss/components/_accordion.scss +90 -0
  9. data/app/assets/stylesheets/scss/components/_card.scss +33 -0
  10. data/app/assets/stylesheets/scss/components/_modal.scss +175 -0
  11. data/app/assets/stylesheets/scss/components/_nav.scss +73 -0
  12. data/app/assets/stylesheets/scss/components/_progress.scss +81 -0
  13. data/app/assets/stylesheets/scss/content/_button.scss +227 -0
  14. data/app/assets/stylesheets/scss/content/_code.scss +91 -0
  15. data/app/assets/stylesheets/scss/content/_embedded.scss +53 -0
  16. data/app/assets/stylesheets/scss/content/_form-alt-input-types.scss +258 -0
  17. data/app/assets/stylesheets/scss/content/_form-checkbox-radio.scss +138 -0
  18. data/app/assets/stylesheets/scss/content/_form.scss +361 -0
  19. data/app/assets/stylesheets/scss/content/_miscs.scss +33 -0
  20. data/app/assets/stylesheets/scss/content/_table.scss +52 -0
  21. data/app/assets/stylesheets/scss/content/_typography.scss +292 -0
  22. data/app/assets/stylesheets/scss/layout/_container.scss +42 -0
  23. data/app/assets/stylesheets/scss/layout/_document.scss +45 -0
  24. data/app/assets/stylesheets/scss/layout/_grid.scss +24 -0
  25. data/app/assets/stylesheets/scss/layout/_scroller.scss +16 -0
  26. data/app/assets/stylesheets/scss/layout/_section.scss +8 -0
  27. data/app/assets/stylesheets/scss/layout/_sectioning.scss +69 -0
  28. data/app/assets/stylesheets/scss/themes/default/_colors.scss +65 -0
  29. data/app/assets/stylesheets/scss/themes/default/_dark.scss +139 -0
  30. data/app/assets/stylesheets/scss/themes/default/_light.scss +139 -0
  31. data/app/assets/stylesheets/scss/themes/default/_styles.scss +238 -0
  32. data/app/assets/stylesheets/scss/themes/default.scss +29 -0
  33. data/app/assets/stylesheets/scss/utilities/_accessibility.scss +54 -0
  34. data/app/assets/stylesheets/scss/utilities/_loading.scss +58 -0
  35. data/app/assets/stylesheets/scss/utilities/_reduce-motion.scss +29 -0
  36. data/app/assets/stylesheets/scss/utilities/_tooltip.scss +105 -0
  37. data/lib/pico/engine.rb +4 -0
  38. data/lib/pico/version.rb +3 -0
  39. data/lib/pico-rails.rb +5 -0
  40. data/pico-rails.gemspec +16 -0
  41. metadata +97 -0
@@ -0,0 +1,227 @@
1
+ /**
2
+ * Button
3
+ */
4
+
5
+ // Reboot based on :
6
+ // - normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
7
+ // - sanitize.css v12.0.1 | CC0 1.0 Universal | github.com/csstools/sanitize.css
8
+ // ––––––––––––––––––––
9
+
10
+ // 1. Change the font styles in all browsers
11
+ // 2. Remove the margin in Firefox and Safari
12
+ // 3. Show the overflow in Edge
13
+ button {
14
+ margin: 0; // 2
15
+ overflow: visible; // 3
16
+ font-family: inherit; // 1
17
+ text-transform: none; // 1
18
+ }
19
+
20
+ // Correct the inability to style clickable types in iOS and Safari
21
+ button,
22
+ [type="button"],
23
+ [type="reset"],
24
+ [type="submit"] {
25
+ -webkit-appearance: button;
26
+ }
27
+
28
+ // Remove the inner border and padding in Firefox
29
+ button::-moz-focus-inner,
30
+ [type="button"]::-moz-focus-inner,
31
+ [type="reset"]::-moz-focus-inner,
32
+ [type="submit"]::-moz-focus-inner {
33
+ padding: 0;
34
+ border-style: none;
35
+ }
36
+
37
+ // Pico
38
+ // ––––––––––––––––––––
39
+
40
+ button {
41
+ display: block;
42
+ width: 100%;
43
+ margin-bottom: var(--spacing);
44
+ }
45
+
46
+ [role="button"] {
47
+ display: inline-block;
48
+ text-decoration: none;
49
+ }
50
+
51
+ button,
52
+ input[type="submit"],
53
+ input[type="button"],
54
+ input[type="reset"],
55
+ [role="button"] {
56
+ --background-color: var(--primary);
57
+ --border-color: var(--primary);
58
+ --color: var(--primary-inverse);
59
+ --box-shadow: var(--button-box-shadow, 0 0 0 rgba(0, 0, 0, 0));
60
+ padding: var(--form-element-spacing-vertical)
61
+ var(--form-element-spacing-horizontal);
62
+ border: var(--border-width) solid var(--border-color);
63
+ border-radius: var(--border-radius);
64
+ outline: none;
65
+ background-color: var(--background-color);
66
+ box-shadow: var(--box-shadow);
67
+ color: var(--color);
68
+ font-weight: var(--font-weight);
69
+ font-size: 1rem;
70
+ line-height: var(--line-height);
71
+ text-align: center;
72
+ cursor: pointer;
73
+
74
+ @if $enable-transitions {
75
+ transition: background-color var(--transition),
76
+ border-color var(--transition), color var(--transition),
77
+ box-shadow var(--transition);
78
+ }
79
+
80
+ &:hover,
81
+ &:active,
82
+ &:focus {
83
+ --background-color: var(--primary-hover);
84
+ --border-color: var(--primary-hover);
85
+ --box-shadow: var(--button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0));
86
+ --color: var(--primary-inverse);
87
+ }
88
+
89
+ &:focus {
90
+ --box-shadow: var(--button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),
91
+ 0 0 0 var(--outline-width) var(--primary-focus);
92
+ }
93
+ }
94
+
95
+ // .secondary, .contrast & .outline
96
+ @if $enable-classes {
97
+
98
+ // Secondary
99
+ button.secondary,
100
+ input[type="submit"].secondary,
101
+ input[type="button"].secondary,
102
+ input[type="reset"],
103
+ [role="button"].secondary {
104
+ --background-color: var(--secondary);
105
+ --border-color: var(--secondary);
106
+ --color: var(--secondary-inverse);
107
+ cursor: pointer;
108
+
109
+ &:hover,
110
+ &:active,
111
+ &:focus {
112
+ --background-color: var(--secondary-hover);
113
+ --border-color: var(--secondary-hover);
114
+ --color: var(--secondary-inverse);
115
+ }
116
+
117
+ &:focus {
118
+ --box-shadow: var(--button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),
119
+ 0 0 0 var(--outline-width) var(--secondary-focus);
120
+ }
121
+ }
122
+
123
+ // Contrast
124
+ button.contrast,
125
+ input[type="submit"].contrast,
126
+ input[type="button"].contrast,
127
+ input[type="reset"].contrast,
128
+ [role="button"].contrast {
129
+ --background-color: var(--contrast);
130
+ --border-color: var(--contrast);
131
+ --color: var(--contrast-inverse);
132
+
133
+ &:hover,
134
+ &:active,
135
+ &:focus {
136
+ --background-color: var(--contrast-hover);
137
+ --border-color: var(--contrast-hover);
138
+ --color: var(--contrast-inverse);
139
+ }
140
+
141
+ &:focus {
142
+ --box-shadow: var(--button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),
143
+ 0 0 0 var(--outline-width) var(--contrast-focus);
144
+ }
145
+ }
146
+
147
+ // Outline (primary)
148
+ button.outline,
149
+ input[type="submit"].outline,
150
+ input[type="button"].outline,
151
+ input[type="reset"].outline,
152
+ [role="button"].outline {
153
+ --background-color: transparent;
154
+ --color: var(--primary);
155
+
156
+ &:hover,
157
+ &:active,
158
+ &:focus {
159
+ --background-color: transparent;
160
+ --color: var(--primary-hover);
161
+ }
162
+ }
163
+
164
+ // Outline (secondary)
165
+ button.outline.secondary,
166
+ input[type="submit"].outline.secondary,
167
+ input[type="button"].outline.secondary,
168
+ input[type="reset"].outline.secondary,
169
+ [role="button"].outline.secondary {
170
+ --color: var(--secondary);
171
+
172
+ &:hover,
173
+ &:active,
174
+ &:focus {
175
+ --color: var(--secondary-hover);
176
+ }
177
+ }
178
+
179
+ // Outline (contrast)
180
+ button.outline.contrast,
181
+ input[type="submit"].outline.contrast,
182
+ input[type="button"].outline.contrast,
183
+ input[type="reset"].outline.contrast,
184
+ [role="button"].outline.contrast {
185
+ --color: var(--contrast);
186
+
187
+ &:hover,
188
+ &:active,
189
+ &:focus {
190
+ --color: var(--contrast-hover);
191
+ }
192
+ }
193
+ }
194
+
195
+ @else {
196
+ // Secondary button without .class
197
+ input[type="reset"] {
198
+ --background-color: var(--secondary);
199
+ --border-color: var(--secondary);
200
+ --color: var(--secondary-inverse);
201
+ cursor: pointer;
202
+
203
+ &:hover,
204
+ &:active,
205
+ &:focus {
206
+ --background-color: var(--secondary-hover);
207
+ --border-color: var(--secondary-hover);
208
+ }
209
+
210
+ &:focus {
211
+ --box-shadow: var(--button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),
212
+ 0 0 0 var(--outline-width) var(--secondary-focus);
213
+ }
214
+ }
215
+ }
216
+
217
+ // Button [disabled]
218
+ // 1. Links without href are disabled by default
219
+ button[disabled],
220
+ input[type="submit"][disabled],
221
+ input[type="button"][disabled],
222
+ input[type="reset"][disabled],
223
+ a[role="button"]:not([href]), // 1
224
+ [role="button"][disabled] {
225
+ opacity: 0.5;
226
+ pointer-events: none;
227
+ }
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Code
3
+ */
4
+
5
+ // Reboot based on :
6
+ // - normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
7
+ // - sanitize.css v12.0.1 | CC0 1.0 Universal | github.com/csstools/sanitize.css
8
+ // ––––––––––––––––––––
9
+
10
+ // 1. Correct the inheritance and scaling of font size in all browsers
11
+ // 2. Correct the font sizing in all browsers
12
+ pre,
13
+ code,
14
+ kbd,
15
+ samp {
16
+ font-size: 0.875em; // 2
17
+ font-family: var(--font-family); // 1
18
+ }
19
+
20
+ // Prevent overflow of the container in all browsers (opinionated)
21
+ pre {
22
+ -ms-overflow-style: scrollbar;
23
+ overflow: auto;
24
+ }
25
+
26
+ // Pico
27
+ // ––––––––––––––––––––
28
+
29
+ pre,
30
+ code,
31
+ kbd {
32
+ border-radius: var(--border-radius);
33
+ background: var(--code-background-color);
34
+ color: var(--code-color);
35
+ font-weight: var(--font-weight);
36
+ line-height: initial;
37
+ }
38
+
39
+ code,
40
+ kbd {
41
+ display: inline-block;
42
+ padding: 0.375rem 0.5rem;
43
+ }
44
+
45
+ pre {
46
+ display: block;
47
+ margin-bottom: var(--spacing);
48
+ overflow-x: auto;
49
+
50
+ > code {
51
+ display: block;
52
+ padding: var(--spacing);
53
+ background: transparent;
54
+ font-size: 14px;
55
+ line-height: var(--line-height);
56
+ }
57
+ }
58
+
59
+ // Code Syntax
60
+ code {
61
+ // Tags
62
+ b {
63
+ color: var(--code-tag-color);
64
+ font-weight: var(--font-weight);
65
+ }
66
+
67
+ // Properties
68
+ i {
69
+ color: var(--code-property-color);
70
+ font-style: normal;
71
+ }
72
+
73
+ // Values
74
+ u {
75
+ color: var(--code-value-color);
76
+ text-decoration: none;
77
+ }
78
+
79
+ // Comments
80
+ em {
81
+ color: var(--code-comment-color);
82
+ font-style: normal;
83
+ }
84
+ }
85
+
86
+ // kbd
87
+ kbd {
88
+ background-color: var(--code-kbd-background-color);
89
+ color: var(--code-kbd-color);
90
+ vertical-align: baseline;
91
+ }
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Embedded content
3
+ */
4
+
5
+ // Reboot based on :
6
+ // - normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
7
+ // - sanitize.css v12.0.1 | CC0 1.0 Universal | github.com/csstools/sanitize.css
8
+ // ––––––––––––––––––––
9
+
10
+ // Change the alignment on media elements in all browsers (opinionated)
11
+ audio,
12
+ canvas,
13
+ iframe,
14
+ img,
15
+ svg,
16
+ video {
17
+ vertical-align: middle;
18
+ }
19
+
20
+ // Add the correct display in IE 9-
21
+ audio,
22
+ video {
23
+ display: inline-block;
24
+ }
25
+
26
+ // Add the correct display in iOS 4-7
27
+ audio:not([controls]) {
28
+ display: none;
29
+ height: 0;
30
+ }
31
+
32
+ // Remove the border on iframes in all browsers (opinionated)
33
+ iframe {
34
+ border-style: none;
35
+ }
36
+
37
+ // 1. Remove the border on images inside links in IE 10.
38
+ // 2. Responsive by default
39
+ img {
40
+ max-width: 100%; // 2
41
+ height: auto; // 2
42
+ border-style: none; // 1
43
+ }
44
+
45
+ // Change the fill color to match the text color in all browsers (opinionated)
46
+ svg:not([fill]) {
47
+ fill: currentColor;
48
+ }
49
+
50
+ // Hide the overflow in IE
51
+ svg:not(:root) {
52
+ overflow: hidden;
53
+ }
@@ -0,0 +1,258 @@
1
+ /**
2
+ * Form elements
3
+ * Alternatives input types (Not Checkboxes & Radios)
4
+ */
5
+
6
+ // Color
7
+ [type="color"] {
8
+ // Wrapper
9
+ @mixin color-wrapper {
10
+ padding: 0;
11
+ }
12
+
13
+ &::-webkit-color-swatch-wrapper {
14
+ @include color-wrapper;
15
+ }
16
+
17
+ &::-moz-focus-inner {
18
+ @include color-wrapper;
19
+ }
20
+
21
+ // Swatch
22
+ @mixin color-swatch {
23
+ border: none;
24
+ border-radius: calc(var(--border-radius) * 0.5);
25
+ }
26
+
27
+ &::-webkit-color-swatch {
28
+ @include color-swatch;
29
+ }
30
+
31
+ &::-moz-color-swatch {
32
+ @include color-swatch;
33
+ }
34
+ }
35
+
36
+ // Date & Time
37
+ // :not() are needed to add Specificity and avoid !important on padding
38
+ input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]) {
39
+ &[type="date"],
40
+ &[type="datetime-local"],
41
+ &[type="month"],
42
+ &[type="time"],
43
+ &[type="week"] {
44
+ --icon-position: 0.75rem;
45
+ --icon-width: 1rem;
46
+ padding-right: calc(var(--icon-width) + var(--icon-position));
47
+ background-image: var(--icon-date);
48
+ background-position: center right var(--icon-position);
49
+ background-size: var(--icon-width) auto;
50
+ background-repeat: no-repeat;
51
+ }
52
+
53
+ // Time
54
+ &[type="time"] {
55
+ background-image: var(--icon-time);
56
+ }
57
+ }
58
+
59
+ // Calendar picker
60
+ [type="date"],
61
+ [type="datetime-local"],
62
+ [type="month"],
63
+ [type="time"],
64
+ [type="week"] {
65
+ &::-webkit-calendar-picker-indicator {
66
+ width: var(--icon-width);
67
+ margin-right: calc(var(--icon-width) * -1);
68
+ margin-left: var(--icon-position);
69
+ opacity: 0;
70
+ }
71
+ }
72
+
73
+ [dir="rtl"] {
74
+ [type="date"],
75
+ [type="datetime-local"],
76
+ [type="month"],
77
+ [type="time"],
78
+ [type="week"] {
79
+ text-align: right;
80
+ }
81
+ }
82
+
83
+ // File
84
+ [type="file"] {
85
+ --color: var(--muted-color);
86
+ padding: calc(var(--form-element-spacing-vertical) * 0.5) 0;
87
+ border: none;
88
+ border-radius: 0;
89
+ background: none;
90
+
91
+ &:hover,
92
+ &:active,
93
+ &:focus {
94
+ border: none;
95
+ background: none;
96
+ }
97
+
98
+ @mixin file-selector-button {
99
+ --background-color: var(--secondary);
100
+ --border-color: var(--secondary);
101
+ --color: var(--secondary-inverse);
102
+ margin-right: calc(var(--spacing) / 2);
103
+ margin-left: 0;
104
+ margin-inline-start: 0;
105
+ margin-inline-end: calc(var(--spacing) / 2);
106
+ padding: calc(var(--form-element-spacing-vertical) * 0.5)
107
+ calc(var(--form-element-spacing-horizontal) * 0.5);
108
+ border: var(--border-width) solid var(--border-color);
109
+ border-radius: var(--border-radius);
110
+ outline: none;
111
+ background-color: var(--background-color);
112
+ box-shadow: var(--box-shadow);
113
+ color: var(--color);
114
+ font-weight: var(--font-weight);
115
+ font-size: 1rem;
116
+ line-height: var(--line-height);
117
+ text-align: center;
118
+ cursor: pointer;
119
+
120
+ @if $enable-transitions {
121
+ transition: background-color var(--transition),
122
+ border-color var(--transition), color var(--transition),
123
+ box-shadow var(--transition);
124
+ }
125
+
126
+ &:hover,
127
+ &:active,
128
+ &:focus {
129
+ --background-color: var(--secondary-hover);
130
+ --border-color: var(--secondary-hover);
131
+ }
132
+ }
133
+
134
+ &::file-selector-button {
135
+ @include file-selector-button;
136
+ }
137
+
138
+ &::-webkit-file-upload-button {
139
+ @include file-selector-button;
140
+ }
141
+
142
+ &::-ms-browse {
143
+ @include file-selector-button;
144
+ }
145
+ }
146
+
147
+ // Range
148
+ [type="range"] {
149
+ // Config
150
+ $height-track: 0.25rem;
151
+ $height-thumb: 1.25rem;
152
+ $border-thumb: 2px;
153
+
154
+ // Styles
155
+ -webkit-appearance: none;
156
+ -moz-appearance: none;
157
+ appearance: none;
158
+ width: 100%;
159
+ height: $height-thumb;
160
+ background: transparent;
161
+
162
+ // Slider Track
163
+ @mixin slider-track {
164
+ width: 100%;
165
+ height: $height-track;
166
+ border-radius: var(--border-radius);
167
+ background-color: var(--range-border-color);
168
+
169
+ @if $enable-transitions {
170
+ transition: background-color var(--transition),
171
+ box-shadow var(--transition);
172
+ }
173
+ }
174
+
175
+ &::-webkit-slider-runnable-track {
176
+ @include slider-track;
177
+ }
178
+
179
+ &::-moz-range-track {
180
+ @include slider-track;
181
+ }
182
+
183
+ &::-ms-track {
184
+ @include slider-track;
185
+ }
186
+
187
+ // Slider Thumb
188
+ @mixin slider-thumb {
189
+ -webkit-appearance: none;
190
+ width: $height-thumb;
191
+ height: $height-thumb;
192
+ margin-top: #{(-($height-thumb * 0.5) + ($height-track * 0.5))};
193
+ border: $border-thumb solid var(--range-thumb-border-color);
194
+ border-radius: 50%;
195
+ background-color: var(--range-thumb-color);
196
+ cursor: pointer;
197
+
198
+ @if $enable-transitions {
199
+ transition: background-color var(--transition),
200
+ transform var(--transition);
201
+ }
202
+ }
203
+ &::-webkit-slider-thumb {
204
+ @include slider-thumb;
205
+ }
206
+
207
+ &::-moz-range-thumb {
208
+ @include slider-thumb;
209
+ }
210
+
211
+ &::-ms-thumb {
212
+ @include slider-thumb;
213
+ }
214
+
215
+ &:hover,
216
+ &:focus {
217
+ --range-border-color: var(--range-active-border-color);
218
+ --range-thumb-color: var(--range-thumb-hover-color);
219
+ }
220
+
221
+ &:active {
222
+ --range-thumb-color: var(--range-thumb-active-color);
223
+
224
+ // Slider Thumb
225
+ &::-webkit-slider-thumb {
226
+ transform: scale(1.25);
227
+ }
228
+
229
+ &::-moz-range-thumb {
230
+ transform: scale(1.25);
231
+ }
232
+
233
+ &::-ms-thumb {
234
+ transform: scale(1.25);
235
+ }
236
+ }
237
+ }
238
+
239
+ // Search
240
+ // :not() are needed to add Specificity and avoid !important on padding
241
+ input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]) {
242
+ &[type="search"] {
243
+ padding-left: calc(var(--form-element-spacing-horizontal) + 1.75rem);
244
+ border-radius: 5rem;
245
+ background-image: var(--icon-search);
246
+ background-position: center left 1.125rem;
247
+ background-size: 1rem auto;
248
+ background-repeat: no-repeat;
249
+ }
250
+ }
251
+
252
+ // Cancel button
253
+ [type="search"] {
254
+ &::-webkit-search-cancel-button {
255
+ -webkit-appearance: none;
256
+ display: none;
257
+ }
258
+ }