clairity.css 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: '03182618c372285ec43b03d258e897e30bd664e63c7a6fb1233ee03bd17d2b4c'
4
+ data.tar.gz: 040110db6d633bbef9bf3d7afc77f6dd72e808e26ecb251bbe39f57645aac97f
5
+ SHA512:
6
+ metadata.gz: 04f1f1637aad3a420dba9a51e226484001f117f404d19f353c90729dde1058c6a73fb4120bd07dbfe2316294a42c60d8c524ce4f4236e1ac8383a79e0504f84a
7
+ data.tar.gz: 8ac5c4c0462ac43df99c4312e6856b6a73e13973b504c9ad5ade8ed656c563d21dfa2a32ef65ce96e295d9d100a5bc18994b157d90256cd8eba2f56bd0eaf47c
@@ -0,0 +1,27 @@
1
+ name: Ruby
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+
8
+ pull_request:
9
+
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+ name: Ruby ${{ matrix.ruby }}
14
+ strategy:
15
+ matrix:
16
+ ruby:
17
+ - '3.2.2'
18
+
19
+ steps:
20
+ - uses: actions/checkout@v3
21
+ - name: Set up Ruby
22
+ uses: ruby/setup-ruby@v1
23
+ with:
24
+ ruby-version: ${{ matrix.ruby }}
25
+ bundler-cache: true
26
+ - name: Run the default task
27
+ run: bundle exec rake
data/.gitignore ADDED
@@ -0,0 +1,66 @@
1
+ # Ignore Mac DS_Store files.
2
+ .DS_Store
3
+
4
+ # Ignore bundler config.
5
+ /.bundle
6
+ /.ruby-version
7
+ /.ruby-gemset
8
+
9
+ # Ignore all logfiles and tempfiles.
10
+ /log/*
11
+ /tmp/*
12
+ !/log/.keep
13
+ !/tmp/.keep
14
+ .sass-cache
15
+ *.swp
16
+ *.swo
17
+
18
+ # Ignore pidfiles, but keep the directory.
19
+ /tmp/pids/*
20
+ !/tmp/pids/
21
+ !/tmp/pids/.keep
22
+
23
+ # Ignore storage (uploaded files in development and any SQLite databases).
24
+ /storage/*
25
+ !/storage/.keep
26
+ /tmp/storage/*
27
+ !/tmp/storage/
28
+ !/tmp/storage/.keep
29
+ /public/assets
30
+ /public/uploads
31
+
32
+ # Ignore master key for decrypting credentials and more.
33
+ /config/master.key
34
+
35
+ # Ignore Byebug command history file.
36
+ .byebug_history
37
+
38
+ # Ignore rspec reports and doc files
39
+ .rspec_status
40
+ /spec/reports/
41
+ /.yardoc
42
+ /_yardoc/
43
+ /coverage/
44
+ /doc/
45
+ /pkg/
46
+
47
+ # Ignore local environment variables.
48
+ /.env
49
+
50
+ # Ignore redis dumps.
51
+ /dump.rdb
52
+
53
+ # Ignore jekyll files
54
+ .jekyll-cache
55
+ .jekyll-metadata
56
+ _site
57
+
58
+ # Ignore vendored files
59
+ vendor
60
+
61
+ # Ignore localhost certs.
62
+ /localhost-cert
63
+
64
+ # Ignore node_modules & yarn errors
65
+ /node_modules
66
+ /yarn-error.log
data/CHANGELOG.md ADDED
@@ -0,0 +1,423 @@
1
+ # <samp class="clairity">clairity.css</samp> Changelog
2
+
3
+ The early parts of this changelog are going to be a little ambiguous and incomplete, as a lot of the initial development happened in 2022 but was only documented (and released) in April 2023. We'll try to be better about that going forward.
4
+
5
+ Expect pre-v1.0 releases to have many backwards incompatible changes, being primarily meant for testing and feedback as we experiment with different approaches to common challenges leading up to a production-ready release.
6
+
7
+
8
+ ## [Unreleased]
9
+
10
+ This section is for recording changes committed since the last release.
11
+
12
+
13
+ ### `clairity.basic.css`
14
+
15
+
16
+ ### `clairity.classless.css`
17
+
18
+
19
+ ### `clairity.css`
20
+
21
+
22
+ ### `variables.css`
23
+
24
+
25
+ ### `palette.css`
26
+
27
+
28
+ ### `functions.css`
29
+
30
+
31
+ ### `icons.css`
32
+
33
+
34
+ ### `base.css`
35
+
36
+
37
+ ### `cosmetic.css`
38
+
39
+
40
+ ### `states.css`
41
+
42
+
43
+ ### `classes.css`
44
+
45
+
46
+ ### `components.css`
47
+
48
+
49
+ ### `utilities.css`
50
+
51
+
52
+
53
+
54
+ ## v0.1.0 - 2023-04-19
55
+
56
+ These changes bring <samp class="clairity">clairity.css</samp> to present day, hence the bump to v0.1.0 rather than v0.0.4. This is also the first version to release on rubygems.
57
+
58
+
59
+ ### `variables.css`
60
+
61
+ * tweak the `--small` font size from `0.9rem` to `0.875rem` for more differentiation with `--medium`
62
+ * add the `--field-max` variable, set to `min(47ch, 100%)`, so that form fields can stretch to a reasonable (but not unreadable) length on larger screens, but take as much space as available on small screens
63
+
64
+
65
+ ### `palette.css`
66
+
67
+ * similar to `--info`, `--success`, `--warning`, and `--error` semantic info colors, add semantic (icon) state colors `--valid` (green), `--invalid` (red) and `--unknown` (yellow), with `-high`, `-low` and `bg-` variants
68
+
69
+
70
+ ### `icons.css`
71
+
72
+ * add `--i-home-edit`, `--i-mail-check`, `--i-mail-x`, `--i-send`, `--i-server-cog`, `--i-user-circle`, `--i-user-off` icons from tabler
73
+
74
+
75
+ ### `base.css`
76
+
77
+ Base acts like a css reset in that it (re-)defines the default styles of all html (pseudo-)elements.
78
+
79
+ * `<nav>`: set `fit-content` on the `height` property to prevent unwanted vertical expansion
80
+ * contain and make input images (`[type=image]`) middle-align with its associated label
81
+ * for form field elements (`<input>`, `<textarea>`, `<select>`, `<optgroup>`, `<option>`, and a `<fieldset>` in a `<form>`), replace `min(47ch, 100%)` value on the `max-width` property with the newly added `--field-max` variable
82
+ * set `max-width` to `--field-max` on `<meter>` and `<progress>` elements as well
83
+
84
+
85
+ ### `cosmetic.css`
86
+
87
+ Cosmetic adjustments typically tweak base styles for specific situations.
88
+
89
+ * remove `<body>` grid from pages that don't have a `<main>` element but do have `<h1>` and/or `<p>` elements (aka, bare pages)
90
+
91
+
92
+ ### `states.css`
93
+
94
+ * define link signifier `--icon`s on the element rather than its `::before` or `::after` pseudo-element, letting inheritance define it for the pseudos
95
+ * move `mailto` link signifier icon to be `::after` the `href` link by default
96
+ * add required field asterisk to required select field's labels as well
97
+ * an `:empty` `<button>` inside an aria `[role=alert]` container is styled as a close ("`⨉`") button
98
+ * added an appropriate `:hover` state as well
99
+ * might want to move this base style to `cosmetic.css` (to allow it to remain part of the `classless` set of styles), or move the whole enchilada to `components.css` with the other button styles
100
+
101
+
102
+ ### `classes.css`
103
+
104
+ * apply `width` and `margin-inline` on `100dvi` class to address the horizontal scrollbar issue (works in some cases, but not all)
105
+ * add semantic state color classes `.valid`, `.invalid`, and `.unknown`
106
+ * add `.i-home-edit`, `.i-mail-check`, `.i-mail-x`, `.i-send`, `.i-server-cog`, `.i-user-circle`, `.i-user-off` icon classes
107
+ * add `.unadorned` class to remove `::before` and `::after` content, which is useful for adding a custom icon to an element that already has a default icon
108
+
109
+
110
+ ### `components.css`
111
+
112
+ * remove top margin from the `:first-child` `<header>` in the `<body>`, typically because this header is meant to sit flush with the top of the page
113
+ * removed the `[role=banner]` selector from this rule, because a banner may not necessarily always sit at the top of the page (even if they often do), as they could be placed inside another container
114
+ * setting the `role` attribute to `banner` on one element is the [recommended way](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/Banner_Role) of designating the site/global banner
115
+ * remove `.subtitle` from spanning a full flex row (was added in v0.0.3)
116
+ * `.banner` component
117
+ * set `align-self` to `flex-start` so it sits flush with the top
118
+ * set `height` to `--banner-height`, which allows us to override it more easily if need be
119
+ * remove extra block margin set on `.banner menu`
120
+ * make sure long-lived site links, like those in a site header, don't get the `:visited` link color, as it can be distracting/disorienting, by adding `[aria-label="primary"]` alongside `nav menu li` to visited links that get the `--link` (rather than `--visited`) color
121
+ * unset unnecessary `color` property for `[aria-current="page"]` links, which makes the active page look "selected" in a nav menu
122
+ * add `.warning` buttons with default, `.secondary`, and `.tertiary` variations and with concommitant `:hover` states
123
+ * update colors of `.danger` buttons to be more visually harmonious
124
+ * add `.secondary` and `.tertiary` variations of `.danger` buttons
125
+ * constrain `form .buttons` to `--field-max`
126
+ * give `.roomy.buttons` some extra `gap`: `--ml` instead of `--s`
127
+ * use container queries (yay!) to fix buttons floating and getting squished on narrower screens, by unsetting `<form>` and form `.buttons` `max-width` and expanding `.buttons` to `full` grid width
128
+ * we also set `<label>` `font-size` to `--small` (it otherwise inherits `--medium` from `<body>`)
129
+ * remove setting `flex-direction` on a `.card` so that a single card by itself doesn't get mangled
130
+ * when providing space for `aside` in the `.grid` in browsers (erm, firefox) not supporting `:has()`, revert testing for support of `:has()` using `selector(:has(+ *))` back to `selector(:has(*))`
131
+ * firefox has limited support for `:has()` currently, and it is therefore [recommended](https://www.bram.us/2023/01/04/css-has-feature-detection-with-supportsselector-you-want-has-not-has/#the-problem) that it be unused on firefox, but we're pre-release, so leave this on for now so we can see how bad it is in firefox
132
+
133
+
134
+ ### `utilities.css`
135
+
136
+ * *rails-specific*: rails adds the `.button_to` class to field-less forms it creates with the `:button_to` helper, and while this mini-form looks like a button, it tries to take up space like a form
137
+ * taking advantage of this narrowly-targeted class, adjust widths on the form and its embedded `submit` button so it looks/behaves like other buttons
138
+ * TODO: this should probably go in `shims.css` if/when we decide to reintroduce it
139
+
140
+
141
+
142
+ ## v0.0.3 - 2023-04-18
143
+
144
+ The changes encompassed by this release were largely completed by about October 2022 (~6 months prior), but recorded (and released) here for posterity.
145
+
146
+
147
+ ### General
148
+
149
+ - in `README.md`, updated the release checklist with correct `git` command to push commits with (annotated) tags
150
+ - added `icons.css` - a minimal set of svg icons exposed as CSS variables
151
+ - emulating the nice developer ergonomics of icon fonts, we overhauled icons entirely so that we can
152
+ - use css variables to define svg icons (rather than being inline defined)
153
+ - use convenience classes to put icons anywhere with just a class definition
154
+ - have icons adjust to light/dark color schemes automatically
155
+ - have icons change color on hover (and generally be responsive to pseudo-classes)
156
+ - all these things together was surprisingly difficult cross-browser
157
+ - added `functions.css` to `clairity.classless.css` even though it includes a few (optional) heading *classes* (.h1, .h2, .h3, etc.), because the fluid typography for headings is so useful
158
+ - we've gone back and forth about the idea of including
159
+ - `normalize.css` (as an alternative css reset)
160
+ - `clairity/shims.css` (to better support, or at least gracefully degrade for, legacy *markup/sites*), and
161
+ - `clairity/legacy.css` (to gracefully degrade for older *browsers*)
162
+ - currently all of these are turned off (i.e., not imported in any <samp class="clairity">clairity.css</samp> entrypoint stylesheet)
163
+ - added block-style comments to css files to differentiate the different sections more easily
164
+
165
+
166
+ ### `clairity.css` file
167
+
168
+ - experimented with the new `@layer` css cascade layers feature, but commented it out for now because it breaks firefox dev tools
169
+
170
+
171
+ ### `variables.css`
172
+
173
+ `variables.css` defines all the custom properties (css variables) used in <samp class="clairity">clairity.css</samp> other than the color palette, which is defined in `palette.css`.
174
+
175
+ - `:root` (defines defaults for both light and dark modes): renamed a number of variables for better semantics
176
+ - moved `--grid` to `functions.css`
177
+ - added `--view-height` variable to set an element to the view height of the viewport
178
+ - changed `--column` from `10rem` to `min(41vw, 10rem)` to force at least 2 columns at narrow widths
179
+ - renamed `--size` (in the `--tiny` ... `--size` ... `--huge` rem relative font scale) to `--medium`
180
+ - renamed `--medium` (in the `--smallest` ... `--medium` ... `--largest` em relative font scale) to `--initial`
181
+ - renamed the `--thinnest` ... `--weight` ... `--boldest` font weight scale to `--lightest` ... `--regular` ... `--boldest`
182
+ - renamed `--line-height` to `--normal` and changed it from `1.5` to `1.45` for aesthetics
183
+ - renamed the `--slimmest` ... `--stroke` ... `--thickest` line/border thickness scale to `--thinnest` ... `--stroke` ... `--thickest`
184
+ - added contextual spacings for icons
185
+ - `--inline-padding` for positioning icons next to text
186
+ - `--button-padding` for positioning icons inside buttons
187
+ - added default icon color variables
188
+ - `--icon-color`
189
+ - `--icon-blend-mode` for use in certain inverted color cases (TODO: reinvestigate this)
190
+ - added the `--heading-inverse` logical text color for inverted heading color contexts (light on dark)
191
+ - made `--background` always be the `Canvas` system color by default, rather than as a backup (`var(--100, Canvas)`) because it turned out to use a slightly different shade on different browsers (lookin' at you safari), which we couldn't replicate easily
192
+ - `:root (prefers-color-scheme: dark)`:
193
+ - added the `--action` logical text color variable for button text
194
+ - redefine `--icon-color` for dark color schemes
195
+ - redefine `--icon-blend-mode` for dark color schemes
196
+ - `:root @supports (color: color-contrast(white vs white, black))`: this is primarily to compensate for safari
197
+ - comment out the redefinition of `--action` (can't remember why)
198
+
199
+
200
+ ### `palette.css`
201
+
202
+ Note that the structure of the color palette, never mind the palette itself, is still very much in flux. Initially, we hoped that one of the new [LCH/okLCH color spaces](https://evilmartians.com/chronicles/oklch-in-css-why-quit-rgb-hsl) would provide a nice perceptually uniform, rich palette that could be programmatically generated and also predictably transformable using css color functions for any color we desired. We wanted to have our cake and to eat it too. But alas, neither LCH or okLCH are truly capable of hands-off, mechanical palette generation and transformation for any set of colors, because of issues like [the dark yellow problem](https://uxdesign.cc/the-dark-yellow-problem-in-design-system-color-palettes-a0db1eedc99d?gi=971e71981fd1). We still like okLCH for its other qualities and will use it where we can, but our hopes of auto-paletting purely in css were but a childlike dream.
203
+
204
+ So with that said, the palette will probably move toward manually-adjusted sets of hue/chroma/lightness tuples in a large matrix of scales for each major color. This seems to be the way other modern frameworks are approaching the color palette issue, even with LCH/okLCH.
205
+
206
+ - hues get a color name variable (e.g., `--blue` or `--red`) because it's difficult to decipher from the numerical value (210 or 4)
207
+ - this means that color names don't represent full colors, as it does in other css frameworks, because we prefer semantic colors for that instead (like `primary` over `blue`, or `accent` over `yellow`)
208
+ - Because of the need for so many scales to define our full palette, we're breaking our general practice of using full semantic names to using short scale names composed of a letter and a number (which also makes our css rules more easily comprehended because the declarations are shorter and more uniform)
209
+ - HSL saturations are converted from `--saturated` and `--unsaturated` to `--s4` and `--s10` (saturation level 4 and saturation level 10)
210
+ - HSL lightnesses go from `--darken` and `--lighten` to `--l4` and `--l7`
211
+ - HSL alpha transparencies go from `--alpha` to `--a0` and `--a1` (these nearly transparent alphas are used to soften white and black toward the underlying hue)
212
+ - LCH chromas go from `--dullest` and `--richest` to `--c0` and `--c9` (still dullest to richest)
213
+ - LCH lightnesses also go from `--darkest` and `--lightest` to an `--l1` and `--l90` percentage scale
214
+ - added `--lighten`, `--darken`, and `--brighten` to `--lightness` as bridge values for LCH
215
+ - EXPERIMENTAL: instead of `primary`, `secondary`, and `tertiary` colors (3 different colors), we define full color scales for `primary`, `secondary`, and `complementary` colors, with `complementary` being the opposing hue (180° difference) of `primary` rather than an independently chosen color. In theory, this should have provided a cohesive 3-color set without having to manually pick a third color, but in practice, the `primary` color needs to be carefully chosen so that the programmatically defined `complementary` color is not only acceptable but well-differentiated from the `secondary` color.
216
+ - EXPERIMENTAL: for okLCH, we define only a color set of `--primary` through `--nonary` (9 colors) and complementary, triadic and tetradic colors (5 additional colors), with no color scales, and assume we'll transform colors on the fly using our chroma, lightness, and alpha scales as needed
217
+ - early indications are that this doesn't work nearly as well as we'd hoped
218
+
219
+
220
+ ### `functions.css`
221
+
222
+ - added `.h1, .h2, .h3, .h4, .h5, .h6` classes to fluid typography heading rule
223
+ - removed experimental relative color scale variables (`--0` through `--15`)
224
+ - `<a>`, `<i>`, `<input>`: added the `--colorize-icon` "function" to add `--icon-color` to any icon via a `linear-gradient`
225
+ - `<body>`, `<main>`, `<header>`, `<footer>`, `<aside>`, `<article>`, `<nav>`, `<section>`, `<div>`
226
+ - moved `--grid` variable for defining grid column widths here from `variables.css`
227
+ - added `--gap` "function" for fluid gap values
228
+ - moved `--padding` here from the `<body>` grid definition in `components.css` for fluid padding values
229
+ - this works in the common case but isn't quite as robust as we'd hoped (TODO: needs investigation)
230
+
231
+
232
+ ### `icons.css`
233
+
234
+ Eventually, we want to have a consistent set of svg icons that are uniform and pleasing, but for now, we grab whatever we can from existing sources, so that we can figure out what the minimal set of icons we need are.
235
+
236
+ - added 10 svg icons as css variables sourced from [almond.css](https://github.com/alvaromontoro/almond.css) and elsewhere (`--i-burger`, `--i-check`, `--i-chevron`, `--i-dash`, `--i-download`, `--i-external`, `--i-search`, `--i-sms`, `--i-tel`)
237
+ - added 14 [tabler icons](https://tabler-icons.io/) as well (`--i-bookmark`, `--i-browser`, `--i-calendar`, `--i-calendar-time`, `--i-external-link`, `--i-edit`, `--i-file`, `--i-file-download`, `--i-lock`, `--i-mail`, `--i-message-2`, `--i-numbers`, `--i-phone`, `--i-trash`)
238
+
239
+
240
+ ### `base.css`
241
+
242
+ - `*, *::before, *::after` (applies to all elements): moved non-essential defaults out of this rule (margin, padding, border, font-size, vertical-align), as `<svg>` documents can also fall under `*` (also `*` rules are less efficient, applying to everything, as it does, so minimize its use)
243
+ - `<main>`, `<aside>`, `<article>`, `<nav>`, `<section>`, `<header>`, `<footer>`: EXPERIMENTAL - designate `inline-size` container name for these common container-type elements
244
+ - `<body>`: make the body fill the viewport height, if content is not enough by itself to do so
245
+ - `<hgroup>`: styled with a strong visual offset
246
+ - `<hgroup>` is deprecated but still useful for containing *just* heading elements, as opposed to all kinds elements, as `<header>` does)
247
+ - `[href^="mailto:"], [href^="tel:"], [href^="sms:"], [href^="file:"], [rel~="external"], [rel~="bookmark"], [download]`: move automatically included icon to the right instead of the left for these link types
248
+ - `<menu>`: remove default left padding and list marker
249
+ - `<th>`, `<td>`: add small top padding
250
+ - `<form>`: change second grid column name from `fullwidth` to `full`
251
+ - `::placeholder`: apparently needs font set explicitly
252
+ - `::file-selector-button`: style like other buttons
253
+ - `<select>`: reformat background image url for svg to fit better
254
+ - `<meter>`, `<progress>`: apply uniform styling to these unruly elements (note that it requires lots of browser-specific pseudos to get working consistently cross-browser)
255
+ - `<code>`, `<var>`: make just bold instead of bolder
256
+ - `<hr>`: make horizontal rules span the full width of a containing grid
257
+
258
+
259
+ ### `cosmetic.css`
260
+
261
+ This file includes cosmetic adjustments to the base elements, typically via combo selectors, which don't fit the scope of `base.css`.
262
+
263
+ - make sectioning containers (`<header>`, `<nav>`, `<main>`, `<section>`, `<div>`, `<figure>` & `<footer>`) that are direct children of `<body>` readable by setting a max-width of `--line-length`, with a width of 100% for smaller screens and auto margins to center the blocks horizontally
264
+ - headings in headers style rule moved here from `states.css`
265
+ - unstyle `<ul>` in `<nav>` elements to let parent styles cascade
266
+ - set grid column to `full` instead of `fullwidth` in accordance with the same change in `base.css`
267
+ - for unordered lists of checkboxes and radio buttons
268
+ - for form headers and paragraphs
269
+ - set the `<select>` element's downward chevron background image to the `--i-chevron` icon variable
270
+ - put left-side labels for checkboxes in the `elements` grid column, left-justified
271
+
272
+
273
+ ### `states.css`
274
+
275
+ The big change here is using css variables for svg masked icons rather than inlining them in the css, so that we can just set any icon to the `--icon` variable to get it to show up. Note that this uses a finicky masking technique that needs to be more fully documented (TODO), but we were able to support hover effects and to get it to support both light and dark modes with some mucking about with `--icon-blend-mode` (set in `variables.css`).
276
+
277
+ - `mailto`, `tel`, `sms`, `file`, `external`, `bookmark`, `download`: completely rewrote rules for link signifier icons
278
+ - unset `--icon-color` on disabled elements' `:hover` state so disabled elements don't visibly hover
279
+ - footnotes/endnotes styles moved to `components.css`
280
+ - move headings in headers style rule to `cosmetic.css`
281
+ - `<table>` styles
282
+ - excluded `<tfoot>` row headers from being sticky
283
+ - lower specificity of rule to skip hidden rows for alternate row highlighting by using `:where()`
284
+ - change grid column from `fullwidth` to `full` in accordance with the same change in `base.css`
285
+ - for `<section>`, `<p>`, and `<div>` elements, as they're typically meant to span the full width of the form
286
+ - for any `<fieldset>` that contains other form elements, as it needs the full width of the form to display it's contents (once subgrid is fully supported, this will be easier)
287
+ - for headings, paragraphs, and divs in `<fieldset>` elements that don't contain form elements (typically that means these are top-level elements, rather than elements ascribed to form fields)
288
+ - set `--icon-color` to `--primary` for `:focus`ed form fields (they're the `Field` system color when unfocused)
289
+ - completely rewrote rules for form field signifier icons
290
+ - this employs a few tricks like our `--colorize-icon` "function" that applies a linear-gradient to color the icon, which layers the color down and uses the icon as a mask
291
+ - a direct application of color wouldn't work in all cases, for both dark & light modes and hover effects
292
+ - requires the svg icon to be white, so as to apply full masking effects and not distort the underlying color layer
293
+ - set the icon by setting `--icon` to one of the svg icon css variables from `icon.css`
294
+ - set icon color via the `--icon-color` variable (set to `--primary` by default for form fields)
295
+ - rewrote rule for `:indeterminate` checkboxes to use the new icon system (the "minus" icon is actually an svg)
296
+ - remove unnecessary `:is()` from rule to disable border `:hover` effect on `:read-only` and `:enabled` fields (which aren't editable, so shouldn't highlight on hover)
297
+ - using `:is()` instead of `:where()`, upped the specificity of the `:disabled` rule for radio buttons and checkboxes so it overrides the global `:disabled` and `:hover` rules
298
+ - `::file-selector-button`: style its `:hover` and `:disabled` states like other buttons and ensure overriding specificity (the underlying pseudo-element rule is defined in `base.css`)
299
+ - add a `:disabled` state to `<input>` of `type="file"`
300
+ - don't let disabled `<select>` and `<option>` elements be hovered (for both attribute `[disabled]` and pseudo-class `:disabled` versions)
301
+ - don't change border color on `:hover` for `<progress>`
302
+ - for non-root `<svg>` elements, lower the specificity using `:where()` and remove the max-width restriction
303
+
304
+
305
+ ### `classes.css`
306
+
307
+ `classes.css` encompasses mostly singular helper class rules, while `components.css` encompasses rules for multiple elements designed to work together. Meanwhile, `utilities.css` is for rules that proxy a single (or perhaps a couple related) underlying css declaration as a class.
308
+
309
+ - added the `.icon` class for elements that want to include an icon
310
+ - added `.leading` and `.trailing` classes for added space for `::before` and `::after` elements, typically icons
311
+ - moved the `.container` class to `utilities.css`
312
+ - moved `.grid` class to `components.css`
313
+ - `.subgrid` - sets declarations related to being a subgrid element
314
+ - used `padded` instead of `paddedwidth` in accordance with the default `<body>` grid set in `components.css`
315
+ - use the `inherit` display value rather than `grid`, so that elements without a gridded parent can display normally
316
+ - unset max-width so that parent can dictate width
317
+ - add the `100vw`/`_100vw` class: sets an element to the full width of the viewport, despite restrictions from the parent (e.g., a grid element)
318
+ - add the `100dvi`/`_100dvi` class: similar to `100vw`, sets the width to the dynamic viewport width, but this still has horizontal scrollbar issues, despite the promise of fixing that
319
+ - moved `.block` to `utilities.css`
320
+ - renamed `.fullwidth` to just `.full` and set max-width to `none` to remove any other width restrictions so this element can span all grid columns
321
+ - renamed `.paddedwidth` to just `.padded`; this class excludes the outer column on each side to the width of the element
322
+ - add `.h1`, `.h2`, `.h3`, `.h4`, `.h5`, `.h6` classes: for styling elements equivalent to their respective heading elements with fluid typography
323
+ - NOTE: because plain css doesn't have mixins (yet, fingers crossed), we have to manually keep this style in sync with the headings styles defined in `base.css`
324
+ - let `.p-subtitle` microformat class be equivalently styled like our `.subtitle` class
325
+ - `.plain` removes decorations from elements (typically `<hgroup>`)
326
+ - added a rule to normalize the spacing (via margin-top) between heading elements for `.plain`-specified elements
327
+ - moved `.button` classes to `components.css` (as buttons are really compact components with lots of little pieces, such as icons)
328
+ - moved `.dual-aside` to `components.css` (as it's related to grid components)
329
+ - added `--flex-break` to `.flex` to set a value to get elements to become single column when below this value
330
+ - added `flex-basis` to `.flex` children that uses this `--flex-break` value
331
+ - added a `.section` class specifically for `<hr>` elements that visually separates sections more boldly
332
+ - moved the `.clairity` class to `utilities.css`
333
+ - added icon classes (as opposed to icon variables): `.i-burger`, `.i-check`, `.i-chevron`, `.i-dash`, `.i-edit`, `.i-mail`, `.i-trash`
334
+ - these allow constructs like `<i class="i-burger"></i>` to show an svg icon, similar to what font icon libraries do (e.g., fontawesome)
335
+
336
+
337
+ ### `components.css`
338
+
339
+ - `<body>` has a default grid applied here
340
+ - rename `fullwidth` grid column name to just `full`
341
+ - rename `paddedwidth` grid column name to just `padded`
342
+ - moved definition of `--padding` "function" to `functions.css`
343
+ - exclude `<main>` elements that are children of `.grid` items from being `padded` width
344
+ - comment out problematic margin-top removal from first `<header>` or `role=banner` element within `<body>`
345
+ - let non-`.banner` `<header>` elements flex
346
+ - let `<p>` and `.subtitle` elements in `<header>`s span a full flex row
347
+ - redefine the `<footer>` grid to be columned
348
+ - let `<p>` children of `<footer>` span the full grid
349
+ - add `.fat` component class for creating a fat footer with an inverted color scheme by default
350
+ - add `.nav` container class so consecutive `<nav>` children can align on the grid nicely
351
+ - TODO: unfortunately wasn't yet able to find a flexible and robust solution for this without a container class for the `<nav>` children
352
+ - headings in footers (typically nav set headings) get special visual treatment (`--muted` color and `--light` weight)
353
+ - links in footers (inverted context) get `--light` weight and `--whitish` (inverted) color with no text decoration by default, unlike regular links
354
+ - footnotes/endnotes styles moved here from `states.css`
355
+ - added rule to make footnotes/endnotes span the full grid in cases where it's in a grid container (does nothing otherwise)
356
+ - moved container (queries) definitions to `base.css` for sectioning elements
357
+ - added helper class for `<i>` elements used solely for icon display
358
+ - our icon classes all start with `i-`, so we use the selector `i[class^='i-']`
359
+ - this applies an `--icon-color` (`--color` or `currentColor`)
360
+ - it masks it using the `--icon` with spacing `--field-icon`
361
+ - it sets the background-color to `--icon-color`
362
+ - it reserves space using `--inline-padding`
363
+ - it sets a min-height of `--ml` to prevent naked icons (with no accompanying text) from collapsing into a line
364
+ - update `.banner` class to better contain it's content
365
+ - added `--content-width` variable to the `.banner` class to constrain `.content` children's widths
366
+ - unset height, max-height and background-color from `.banner`
367
+ - add block margin to `.banner` `<menu>` elements
368
+ - add the `.hero` class to the `.banner > img` rule
369
+ - remove default styling from `<figure>` elements in `.banner` elements
370
+ - changed `.column` align-items declaration from `flex-start` to just `start`
371
+ - inline-flex and center `<div>`s that are children of `<nav>`s
372
+ - `<nav>` `<menu>` links shouldn't get a differentiated `:visited` color
373
+ - don't unset the background-color of `type=search` elements in `<nav>`s
374
+ - make a `[aria-current="page"]` link non-clickable to differentiate it from links to other pages
375
+ - comment out rule setting padded on `nav.column` elements that are not direct children of `<aside>` due to visual issues
376
+ - moved `.button` classes here from `classes.css`
377
+ - set color to `--background` in `.toggle` button style
378
+ - add `.danger` type button for dangerous actions
379
+ - add `.tertiary` type button for less common actions (`.secondary` is defined as an inverted color button for less prominence)
380
+ - moved `.grid` classes here from `classes.css`
381
+ - rename `.form.grid` grid column name from `fullwidth` to `full`
382
+ - moved `.dual-aside` here from `classes.css`
383
+ - moved `<meter>` and `<progress>` pseudo-class definitions to `base.css` (which had the base element definitions already)
384
+
385
+
386
+ ### `utilities.css`
387
+
388
+ - moved `.container` here from `classes.css`
389
+ - moved `.block` here from `classes.css`
390
+ - `.centered`, `.centered menu`: horizontally center text and menu items
391
+ - `.center`: center flex content
392
+ - `.right`: end-align flex content
393
+ - `.shadow`: add a box shadow to an element
394
+ - moved `.clairity` here from `classes.css`: sets a differentiating font for our favorite css framework!
395
+
396
+
397
+ ## v0.0.2 - 2023-04-15
398
+
399
+ After a number of diversions, including developing a (as yet unreleased) Jekyll theme for <samp class="clairity">clairity.css</samp>, our attention is back on the core css framework. This release packages <samp class="clairity">clairity.css</samp> as a Rails engine so we can use it in our Rails projects.
400
+
401
+ - First packaging as a gem, built as a Rails engine atop Railties
402
+ - Puts all imported files in a subdirectory to clarify the hierarchy of files
403
+ - `clairity.basic.css` - an alternate stylesheet that includes only `variables.css` and `base.css` to provide a solid base for building a simple site or perhaps your own css framework
404
+ - `clairity.classless.css` - a classless alternative stylesheet that provides a rich and clean visual design but imposes no classes of its own
405
+ - `[normalize.css](https://github.com/necolas/normalize.css)` (reformatted to our liking) - optional css normalization library that retains useful defaults
406
+ - functions.css - provides a clamped, smoothly varying font size for headings
407
+ - `cosmetic.css` - split out any non-core/composite rules involving html elements here
408
+ - `states.css` - mainly for pseudo-classes and pseudo-elements
409
+ - `classes.css` - for class-based rules as opposed to element-based ones
410
+ - `components.css` - for composite html structures involving multiple elements
411
+ - `utilities.css` - to house a limited number of utility styles like `.visually-hidden`
412
+ - `shims.css` - a place to put styles meant to support graceful degradation for older sites (not browsers, that goes in `legacy.css`)
413
+
414
+
415
+ ## v0.0.1 - 2022-06-24
416
+
417
+ <samp class="clairity">clairity.css</samp> was inspired by classless css libraries like `almond.css` and `sakura.css`, as well as a longing for a nice semantic, HTML-first css framework, like a modernized Semantic UI, but employing cutting-edge css features to remove the need for css tooling (i.e., Sass).
418
+
419
+ - Start of development
420
+ - `clairity.css` - the main entrypoint, which imports the other css files as desired
421
+ - `variables.css` - structure css variables (custom properties) for flexible theming
422
+ - `base.css` - add styling block for every html element, even if empty
423
+ - `palette.css` - separate out the color scheme into its own css file
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+ source "https://rubygems.org"
3
+
4
+ # gem dependencies in clairity.css.gemspec
5
+ gemspec