clairity.css 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,68 @@
1
+ /******************************************************************************\
2
+ UTILITIES - a limited set of utilities that can override all the other styles
3
+ that precede them. use sparingly and mindfully. these usually do
4
+ only one or two things. [0010] specificity unless otherwise noted.
5
+ \******************************************************************************/
6
+
7
+ /* #visually-hidden - provide non-visual information semantically & accessibly*/
8
+ /* :not() with a selection list has poor backwards compatibility as of 2022, so
9
+ use separate :not() clauses for now */
10
+ .visually-hidden:not(:focus):not(:active):not(:focus-within) { /* ie9+ */
11
+ position: absolute;
12
+ width: 1px;
13
+ height: 1px;
14
+ overflow: hidden;
15
+ clip: rect(0 0 0 0);
16
+ white-space: nowrap;
17
+ margin: -1;
18
+ padding: 0;
19
+ border: 0;
20
+ }
21
+
22
+
23
+ /* -----------------------------------------------------------------------------
24
+ // #containers -
25
+ // -------------------------------------------------------------------------- */
26
+
27
+ /* generic container class for container queries. only supported in
28
+ safari 16+ and chrome 93+ behind a flag - EXPERIMENTAL */
29
+ .container { container: inline-size / container; }
30
+
31
+
32
+ /* -----------------------------------------------------------------------------
33
+ // #positioning - visual utilities to place items in certain relative locations
34
+ // -------------------------------------------------------------------------- */
35
+
36
+ /* override display mode to be block */
37
+ .block { display: block; }
38
+
39
+ /* horizontally center text and menu items */
40
+ .centered { text-align: center; }
41
+ .centered menu { justify-content: center; } /* [0011] specificity */
42
+
43
+ /* flex positioning utilities */
44
+ .center { justify-content: center; }
45
+ .right { justify-content: flex-end; }
46
+
47
+
48
+ /* -----------------------------------------------------------------------------
49
+ // #borders & #shadows - container boundary utlities
50
+ // -------------------------------------------------------------------------- */
51
+
52
+ .shadow { box-shadow: var(--shadow) var(--300); }
53
+
54
+
55
+ form.button_to {
56
+ width: min-content;
57
+ }
58
+
59
+ form.button_to > [type="submit"] {
60
+ width: max-content;
61
+ }
62
+
63
+ /* -----------------------------------------------------------------------------
64
+ // #clairity - special font just for fun
65
+ // -------------------------------------------------------------------------- */
66
+ .clairity { font-family: Corbel, "Lucida Grande", "Lucida Sans Unicode",
67
+ "Lucida Sans", "DejaVu Sans", "Bitstream Vera Sans",
68
+ "Liberation Sans", Verdana, "Verdana Ref",sans-serif;}
@@ -0,0 +1,301 @@
1
+ /******************************************************************************\
2
+ CSS VARIABLES - these are global params that you may want to edit to match
3
+ the style of your site
4
+
5
+ Support for CSS variables (custom properties) goes back at
6
+ least 5 years for the major browsers and cover about 95% of
7
+ global users, but we're implicitly eschewing IE here, as it
8
+ never supported CSS variables.
9
+
10
+ * First we define our primitive CSS variable values, and then we assign those
11
+ to logical variables that can be used in different color schemes and media
12
+ preferences without having to do the mapping in our main stylesheet.
13
+ * We take the strategy of defining default values for properties using the
14
+ same name as the property, so for font-size, we'll use --font-size. We'll
15
+ avoid prefixes & compound names as much as possible to keep variable names
16
+ as short as possible. The most notable exception is the use of bg- for
17
+ background colors harmonious with their foreground counterparts. In general,
18
+ shorter names will be used first for more common variables, while less
19
+ common variables might get longer names if a conflict arises. color and
20
+ spacing variables tend to be used the most, so these get preferential
21
+ treatment (shorter, single-word names).
22
+ * Since palette.css is optional, we declare color-scheme here rather than in
23
+ that file, and we use system colors here as a fallback as well.
24
+ \******************************************************************************/
25
+
26
+ /* :root rather than html so other doctypes like svg can use these variables */
27
+ :root {
28
+
29
+ color-scheme: light dark; /* list allowable color schemes */
30
+
31
+
32
+ /* ---------------------------------------------------------------------------
33
+ // #layout - custom lengths for layouts and containers
34
+ // ------------------------------------------------------------------------ */
35
+
36
+ --view-height: 100vh; /* use 100dvb when widely supported */
37
+ --line-length: min(80ch, 100%); /* for readability */
38
+
39
+ /* breakpoints - for grid/flex/container queries; try to avoid media queries*/
40
+ --column: min(41vw, 10rem); /* allows 2 cols @ 320px wide */
41
+ --container: 18ch; /* standard width of a container */
42
+
43
+ /* form fields */
44
+ --width: 16ch; /* ch-based to show enough chars in field */
45
+ --height: 2.5rem; /* em-based to scale with field text size */
46
+ --field-max: min(47ch, 100%); /* to accommodate smaller screens */
47
+
48
+
49
+ /* ---------------------------------------------------------------------------
50
+ // #font - font families, sizes, weights, and line heights
51
+ // ------------------------------------------------------------------------ */
52
+
53
+ /* font families */
54
+ --sans-serif: system-ui, Helvetica, "Helvetica Neue", "Avenir Next",
55
+ Avenir, "Nimbus Sans L", Roboto, Noto, "Segoe UI",
56
+ Arial, sans-serif;
57
+ --serif: "Times New Roman", "Times", serif;
58
+ --monospace: Consolas, Menlo, Monaco, "Andale Mono", "Ubuntu Mono",
59
+ monospace;
60
+
61
+ /* font sizes - rem-based to be responsive but disregard nesting; em/rem-based
62
+ fonts scale with the user's zoom level, unlike px-based values*/
63
+ --tiny: 0.75rem;
64
+ --small: 0.875rem;
65
+ --medium: 1rem;
66
+ --large: 1.2rem;
67
+ --huge: 1.5rem;
68
+ /* #em - contextually relative font sizes */
69
+ --smallest: 0.5em;
70
+ --smaller: 0.75em;
71
+ --initial: 1em;
72
+ --larger: 1.25em;
73
+ --largest: 1.5em;
74
+
75
+ /* font weights - the scale can be adjusted up and down as desired */
76
+ --lightest: 100;
77
+ --lighter: 200;
78
+ --light: 300;
79
+ --regular: 400;
80
+ --bold: 500;
81
+ --bolder: 600;
82
+ --boldest: 700;
83
+
84
+ /* Line heights - unitless distance between lines of text */
85
+ --normal: 1.45; /* 1.2 is the typical browser default */
86
+ --compact: 1.2;
87
+ --relaxed: 1.8;
88
+
89
+
90
+ /* ---------------------------------------------------------------------------
91
+ // #spacing #sizing #positioning - margin/padding scales, custom spaces/sizes
92
+ // ------------------------------------------------------------------------ */
93
+
94
+ /* space scale - rem-based to be relative to html root, not element, font size
95
+ these oft-used variables employ t-shirt sizing for the shortest names */
96
+ --xxs: 0.125rem;
97
+ --xs: 0.25rem;
98
+ --s: 0.5rem;
99
+ --ms: 0.75rem;
100
+ --m: 1rem;
101
+ --ml: 1.5rem;
102
+ --l: 2rem;
103
+ --xl: 4rem;
104
+ --xxl: 8rem;
105
+
106
+ /* contextual spacing - mainly for headers & icons among surrounding content*/
107
+ /*--margin: var(--ml) 0 var(--m);*/ /* rem-based */
108
+ --margin: var(--initial) 0 var(--smallest); /* em-based */
109
+ --inline-padding: 0 var(--ms) var(--xxs) var(--ms);
110
+ --button-padding: var(--s) var(--ms);
111
+
112
+ /* background icon sizes - purposefully em-based to fit context */
113
+ --text-icon: 1em 1em;
114
+ --field-icon: 1.5em 1.5em;
115
+
116
+ /* background positions */
117
+ --center-left: 0rem 50%;
118
+ --center-right: 100% 50%;
119
+ --padded-center-left: 0.5em 50%;
120
+ --padded-center-right: calc(100% + 0.5em) 50%;
121
+
122
+
123
+ /* ---------------------------------------------------------------------------
124
+ // #border #shadow -
125
+ // ------------------------------------------------------------------------ */
126
+
127
+ /* line/border thicknesses - px-based since these are screen-oriented */
128
+ --thinnest: 0.33px;
129
+ --thinner: 0.5px;
130
+ --thin: 0.75px;
131
+ --stroke: 1px;
132
+ --thick: 2px;
133
+ --thicker: 3px;
134
+ --thickest: 5px;
135
+
136
+ /* radii */
137
+ --radius: 4px; /* standard border radius */
138
+ --circle: 50%; /* border radius to create a circle */
139
+
140
+ /* borders - use in conjunction with a border color */
141
+ --solid: var(--stroke) solid;
142
+ --fat: var(--thicker) solid;
143
+ --dashed: var(--stroke) dashed;
144
+ --dotted: var(--stroke) dotted;
145
+
146
+ /* shadows - use in conjunction with a shadow color */
147
+ --inset: inset 0 0 0 0.185rem;
148
+ --groove: inset 0 var(--thick) var(--thickest);
149
+ --shadow: 0 var(--thick) var(--thickest);
150
+
151
+
152
+ /* ---------------------------------------------------------------------------
153
+ // #duration - for transitions
154
+ // ------------------------------------------------------------------------ */
155
+
156
+ --fastest: 150ms;
157
+ --fast: 250ms;
158
+ --transition: 300ms;
159
+ --slow: 400ms;
160
+ --slowest: 500ms;
161
+
162
+
163
+ /* ---------------------------------------------------------------------------
164
+ // #color mappings - maps palette colors to semantic variables
165
+ // ------------------------------------------------------------------------ */
166
+
167
+ /* transparencies - fallback to grayscale if primary is not set */
168
+ --pale: var(--primary-200, hsl(210, 0%, 45%, 0.2) );
169
+ --translucent: var(--primary-transparent,hsl(210, 0%, 45%, 0.1));
170
+ --transparent: hsl(0, 0%, 45%, 0.05);
171
+
172
+ /* Absolute text colors - doesn't change with color scheme */
173
+ --whitish: var(--100, snow);
174
+ --blackish: var(--900, darkslategrey);
175
+
176
+ /* Logical text colors - depends on color-scheme - dark on light is default */
177
+ --text: var(--700, CanvasText); /* default text color */
178
+ --heading: var(--primary-700, LinkText); /* heading text */
179
+ --heading-inverse: var(--primary-bright, dodgerblue);
180
+ /* semantically relative text colors */
181
+ --distinct: var(--secondary-700, firebrick);
182
+ --inverse: var(--100, Canvas); /* for inverted light/dark */
183
+ --loud: var(--primary-800, --800); /* higher gravity text */
184
+ --muted: var(--700, GrayText); /* for secondary text */
185
+ --inactive: var(--500, GrayText); /* for deactivated text */
186
+ --mark: var(--100, Canvas); /* MarkText is unsupported */
187
+
188
+ /* Logical link colors - features our primary color because it's blue */
189
+ --link: var(--primary, LinkText);
190
+ --visited: var(--primary-700, VisitedText);
191
+ --active: var(--primary-500, ActiveText);
192
+
193
+ /*Other system text colors - currently unused, but included for completeness*/
194
+ --field: var(--900, FieldText);
195
+ --action: var(--100, ButtonText);
196
+ --highlight: var(--100, HighlightText);
197
+ /* SelectedItemText is unsupported in safari/chrome, so we don't use it here*/
198
+ --select: var(--100, Canvas); /* checkbox/select */
199
+
200
+ /* Logical foreground color - for featuring key elements like buttons/inputs,
201
+ closely related to the built-in accent-color. accent-color is currently
202
+ only used to style range elements. checkboxes, radio buttons, and progress
203
+ bars are other options stylable by accent-color, but all are restyled. */
204
+ --foreground: var(--primary, LinkText); /* for primary actions */
205
+ accent-color: var(--primary); /* has its own default fallback */
206
+
207
+ /* Logical selection colors - for selects, checkboxes, and radio buttons.
208
+ unselected text & background are inherited/default */
209
+ /* SelectedItem is unsupported in safari/chrome, so we don't use it here */
210
+ --checked: var(--foreground); /* checked / selected */
211
+ --unchecked: var(--bg-field); /* to ensure consistency */
212
+ --deactivated: var(--300, ButtonFace); /* selected but unfocused */
213
+ --contrast: var(--primary-200, azure); /* slight contrast */
214
+
215
+ /* Logical background colors - prefixed with bg- to show strong relationship
216
+ with corresponding text color (i.e., they're meant to be used together) */
217
+ --background: Canvas; /* primary background color */
218
+ --bg-field: Field; /* field background color */
219
+ --bg-distinct: var(--secondary-100, lavenderblush); /* stand out */
220
+ --bg-inverse: var(--900, CanvasText); /* for inverted contexts */
221
+ --bg-highlight: var(--primary-600, Highlight); /* for relating
222
+ prospective action/relevance - hovering for example */
223
+ --bg-contrast: var(--200, ButtonFace); /* slight contrast color */
224
+ --bg-inactive: var(--300, ButtonFace); /* for disabled elements */
225
+ --bg-mark: var(--primary-bright, LinkText); /* the Mark system
226
+ color is not supported yet, so use another fallback instead */
227
+
228
+ /* Logical border colors */
229
+ --border: var(--500, GrayText); /* default */
230
+ --emphasized: var(--600, GrayText); /* darkens to emphasize */
231
+ --deemphasized: var(--300, ButtonFace); /* lightens to deemphasize */
232
+ --highlighted: var(--primary, LinkText); /* make it stand out */
233
+ --marked: var(--primary-bright, LinkText); /* no Mark */
234
+ --distinguished: var(--secondary-300, palevioletred); /* stand out */
235
+
236
+ /* default color of icons - change it by redefining this in a given scope */
237
+ --icon-color: var(--border);
238
+ --icon-blend-mode: lighten, difference;
239
+ }
240
+
241
+ /* backdrops don't inherit anything, including from :root/html */
242
+ :root, ::backdrop {
243
+ --backdrop: hsl(0, 0%, 5%, 50%); /* backdrop color for modals */
244
+ }
245
+
246
+ /* -----------------------------------------------------------------------------
247
+ // #dark mode - adjustments to the semantic color variables for dark mode
248
+ // -------------------------------------------------------------------------- */
249
+
250
+ @media (prefers-color-scheme: dark) {
251
+ :root {
252
+ /* Calculated colors */
253
+ /* CSS relative colors, once implemented, can be used to generate these */
254
+ --error-high: hsl(var(--red), 100%, 67%);
255
+ --error-low: hsl(var(--red), 80%, 60%);
256
+ /* Logical text colors */
257
+ --text: var(--100, CanvasText); /* primary text color */
258
+ --heading: var(--primary-bright, dodgerblue); /* LinkText is too
259
+ dark on chrome/safari */
260
+ --distinct: var(--secondary-100, lavenderblush);
261
+ --inverse: var(--900, Canvas); /* for inverted light/dark */
262
+ --loud: var(--primary-300, --300); /* higher gravity text */
263
+ --muted: var(--400, GrayText); /* for secondary text */
264
+ --inactive: var(--600, ButtonText);
265
+ --mark: var(--100, CanvasText); /* MarkText is unsupported */
266
+ /* Logical link colors - features our primary color because it's blue */
267
+ --link: var(--primary-500, dodgerblue); /* LinkText is too
268
+ dark on chrome/safari */
269
+ --visited: var(--primary-600, mediumorchid);
270
+ --active: var(--primary-400, ActiveText);
271
+ --action: ButtonText;
272
+ /* Logical foreground colors */
273
+ --contrast: var(--primary-900, GrayText); /* for inverted
274
+ hover/zebra */
275
+ --deactivated: var(--700); /* disabled, selected checks/radios */
276
+ /* Logical background colors */
277
+ --background: Canvas;
278
+ --bg-distinct: var(--secondary, palevioletred);
279
+ --bg-inverse: var(--100, CanvasText);
280
+ --bg-highlight: var(--primary-600, ActiveText);
281
+ --bg-contrast: var(--900, Field);
282
+ --bg-inactive: var(--700, GrayText);
283
+ /* Logical border colors */
284
+ --emphasized: var(--100); /* lightens to emphasize */
285
+ --deemphasized: var(--700, ButtonFace); /* darkens to deemphasize */
286
+
287
+ --icon-color: var(--500);
288
+ --icon-blend-mode: darken, normal;
289
+ }}
290
+
291
+ /* Safari has poor support for CSS system colors, so compensate for it for now;
292
+ Safari TP has experimental support for color-contrast() however */
293
+ @supports (color: color-contrast(white vs white, black)) {
294
+ :root {
295
+ /*--action: var(--100, color-contrast(var(--foreground) vs*/
296
+ /*Canvas, ButtonText));*/
297
+ }}
298
+ @supports (background-color: -apple-system-control-background) {
299
+ :root {
300
+ --bg-field: -apple-system-control-background;
301
+ }}
@@ -0,0 +1,28 @@
1
+ /******************************************************************************\
2
+ BASIC - This is a variation of clairity.css that only includes the most basic
3
+ elemental styles. Use this as a classless base for creating simple,
4
+ content-oriented, semantic web pages, or as a jumping off point for
5
+ your own css framework
6
+ \******************************************************************************/
7
+
8
+
9
+ /* -----------------------------------------------------------------------------
10
+ // 01 settings - uses only CSS variables and no CSS preprocessor. variables
11
+ // and the palette can each (or both) be wholesale replaced if desired.
12
+ // -------------------------------------------------------------------------- */
13
+
14
+ /* variables - REQUIRED - core css variables, color mappings, and fallbacks */
15
+ @import "clairity/variables.css";
16
+
17
+ /* palette - if not included, use system colors as defined in variables.css */
18
+ /*@import "clairity/palette.css";*/
19
+
20
+
21
+ /* -----------------------------------------------------------------------------
22
+ // 04 elements - base, elemental styling, but no classes or components.
23
+ //
24
+ // -------------------------------------------------------------------------- */
25
+
26
+ /* base - REQUIRED - styles for all base html elements as well as common
27
+ pseudo-elements and pseudo-classes */
28
+ @import "clairity/base.css";
@@ -0,0 +1,50 @@
1
+ /******************************************************************************\
2
+ CLASSLESS - This variation of clairity.css extends clairity.basic.css with
3
+ cosmetic enhancements, but remains classless, except for a few
4
+ optional header (functions.css) classes (.h1, .h2, .h3, etc.).
5
+ \******************************************************************************/
6
+
7
+
8
+ /* -----------------------------------------------------------------------------
9
+ // 01 settings - uses only CSS variables and no CSS preprocessor. variables
10
+ // and the palette can each (or both) be wholesale replaced if desired.
11
+ // -------------------------------------------------------------------------- */
12
+
13
+ /* variables - REQUIRED - core css variables, color mappings, and fallbacks */
14
+ @import "clairity/variables.css";
15
+
16
+ /* palette is optional - if not defined, clairity.css will use system colors */
17
+ @import "clairity/palette.css";
18
+
19
+
20
+ /* -----------------------------------------------------------------------------
21
+ // 02 tools - for mixins and functions, but not via any CSS preprocessor.
22
+ // -------------------------------------------------------------------------- */
23
+
24
+ /* functions - css variables acting as functions, such as for fluid typography*/
25
+ @import "clairity/functions.css";
26
+
27
+ /* icons - an optional svg icon set */
28
+ @import "clairity/icons.css";
29
+
30
+
31
+ /* -----------------------------------------------------------------------------
32
+ // 04 elements - base, elemental styling, but no classes or components.
33
+ //
34
+ // -------------------------------------------------------------------------- */
35
+
36
+ /* base - REQUIRED - styles for all base html elements as well as common
37
+ pseudo-elements and pseudo-classes */
38
+ @import "clairity/base.css";
39
+
40
+ /* cosmetic - optional - multi-element cosmetic fixes beyond the scope of base*/
41
+ @import "clairity/cosmetic.css";
42
+
43
+
44
+ /* -----------------------------------------------------------------------------
45
+ // 05 objects - pseudo-classes with more personality than the base.
46
+ //
47
+ // -------------------------------------------------------------------------- */
48
+
49
+ /* states - primarily higher specificity pseudo-classes for the base elements */
50
+ @import "clairity/states.css";
@@ -0,0 +1,109 @@
1
+ /******************************************************************************\
2
+ IMPORTS - clairity.css is a simple, semantic html-first design
3
+ system-in-the-making. For modularilty, we loosely follow the ITCSS
4
+ organizational method. This file imports the various layers of
5
+ the system as individual files. We don't get dogmatic about this
6
+ structure however, and eschew rigid naming conventions like BEM or
7
+ verbose utility-first approaches like Tailwind.
8
+
9
+ Note that we're starting with the cutting-edge of CSS features, so
10
+ we'll support browsers from early 2020 and forward. That means no
11
+ IE support at all. We'll add *some* graceful degradation for older
12
+ browsers in legacy.css, and older markup techniques in shims.css.
13
+
14
+ variables.css and base.css form the core of clairity.css so are
15
+ de facto required, otherwise you may as well use another system or
16
+ build your own. anything else can be removed/replaced as desired.
17
+ The layers are each meant to progressively enhance anything prior,
18
+ so feel free to use as much or as little as you'd like. Customize
19
+ clairity.css by creaing your own css import file (e.g., "style.css")
20
+ and importing only the css component files you want.
21
+ \******************************************************************************/
22
+
23
+
24
+ /* -----------------------------------------------------------------------------
25
+ // 00 css cascade layers - NOTE: firefox 100 dev tools breaks on layers.
26
+ // -------------------------------------------------------------------------- */
27
+
28
+ /*@layer clairity.settings, clairity.tools, clairity.generic, clairity.elements,
29
+ clairity.objects, clairity.components, clairity.utilities;*/
30
+
31
+
32
+ /* -----------------------------------------------------------------------------
33
+ // 01 settings - uses only CSS variables, and no CSS preprocessor. variables
34
+ // and the palette can each (or both) be wholesale replaced if desired.
35
+ // -------------------------------------------------------------------------- */
36
+
37
+ /* variables - REQUIRED - core css variables, color mappings, and fallbacks */
38
+ @import "clairity/variables.css";/* layer(clairity.settings);*/
39
+
40
+ /* palette (optional)- if unavailable, uses system colors defined in variables*/
41
+ @import "clairity/palette.css";/* layer(clairity.settings);*/
42
+
43
+
44
+ /* -----------------------------------------------------------------------------
45
+ // 02 tools - for mixins and functions, but not via any CSS preprocessor.
46
+ // -------------------------------------------------------------------------- */
47
+
48
+ /* functions - css variables acting as functions, such as for fluid typography*/
49
+ @import "clairity/functions.css";/* layer(clairity.tools);*/
50
+
51
+ /* icons - an optional svg icon set */
52
+ @import "clairity/icons.css";/* layer(clairity.tools);*/
53
+
54
+
55
+ /* -----------------------------------------------------------------------------
56
+ // 03 generic - the normalization/reset layer - a few essential styles from
57
+ // this layer are integrated into base.css, as noted in that file.
58
+ // -------------------------------------------------------------------------- */
59
+
60
+ /* normalize.css - optional - "a modern alternative to CSS resets" */
61
+ /*@import "clairity/normalize.css";*//* layer(clairity.generic); */
62
+
63
+
64
+ /* -----------------------------------------------------------------------------
65
+ // 04 elements - default styling for all the base elements - cosmetic.css adds
66
+ // a few visual niceties.
67
+ // -------------------------------------------------------------------------- */
68
+
69
+ /* base - styles for all base html elements & common pseudo-elements/-classes */
70
+ @import "clairity/base.css";/* layer(clairity.elements);*/
71
+
72
+ /* cosmetic - optional - multi-element cosmetic fixes beyond the scope of base*/
73
+ @import "clairity/cosmetic.css";/* layer(clairity.elements);*/
74
+
75
+
76
+ /* -----------------------------------------------------------------------------
77
+ // 05 objects - classes & pseudo-classes with more personality than the base.
78
+ // This is where we move beyond the classlessness of the base clairity.css.
79
+ // -------------------------------------------------------------------------- */
80
+
81
+ /* states - primarily higher specificity pseudo-classes for the base elements */
82
+ @import "clairity/states.css";/* layer(clairity.objects);*/
83
+
84
+ /* classes - provide alternate stylings for elements via class declarations */
85
+ @import "clairity/classes.css";/* layer(clairity.objects);*/
86
+
87
+
88
+ /* -----------------------------------------------------------------------------
89
+ // 06 components - common design patterns beyond singular states and classes.
90
+ // These are intentionally contained in a single file rather than split up.
91
+ // -------------------------------------------------------------------------- */
92
+
93
+ /* components - common design patterns like alert boxes and cards. */
94
+ @import "clairity/components.css";/* layer(clairity.components);*/
95
+
96
+
97
+ /* -----------------------------------------------------------------------------
98
+ // 07 utilities - sparingly-used but wide-reaching overrides.
99
+ // -------------------------------------------------------------------------- */
100
+
101
+ /* utlities - wide-reaching overrides, like a .visually-hidden class. */
102
+ @import "clairity/utilities.css";/* layer(clairity.utilities);*/
103
+
104
+ /* shims - supports certain common markup patterns that are less semantic.
105
+ Import these when adding clairity.css to older sites. [OPTIONAL] */
106
+ /*@import "clairity/shims.css" layer(clairity.utilities);*/
107
+
108
+ /* legacy - provides graceful degradation for older browsers. [OPTIONAL] */
109
+ /*@import "clairity/legacy.css" layer(clairity.utilities);*/
Binary file
Binary file
@@ -0,0 +1,6 @@
1
+ // TEMP: needed to get buttons in safari to gain focus on click
2
+ document.addEventListener('click', function (event) {
3
+ if (event.target.matches('button')) {
4
+ event.target.focus();
5
+ }
6
+ });
Binary file
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ClairityCss
4
+ VERSION = '0.1.0'
5
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+ require_relative 'clairity.css/version'
3
+ # needed for `rake test`, otherwise: uninitialized constant Rails (NameError)
4
+ require 'rails/engine'
5
+
6
+ # this is an asset-only gem to provide the clairity.css framework to parent apps
7
+ module ClairityCss
8
+ class Error < StandardError; end
9
+ class Engine < ::Rails::Engine; end
10
+ end
@@ -0,0 +1,4 @@
1
+ module ClairityCss
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "test_helper"
4
+
5
+ class TestClairityCss < Minitest::Test
6
+
7
+ def test_it_has_a_version_number
8
+ refute_nil ::ClairityCss::VERSION
9
+ end
10
+
11
+ def test_css_assets_are_available
12
+ # TODO: create a dummy rails app that includes the clairity.css gem to make
13
+ # sure assets are accessible to the (dummy) rails app
14
+ assert true
15
+ end
16
+
17
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.unshift File.expand_path("../lib", __dir__)
4
+ require "clairity.css"
5
+ require "minitest/autorun"