css-is-awesome 1.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.
- package/AGENTS.md +343 -0
- package/CHANGELOG.md +1036 -0
- package/CLAUDE.md +9 -0
- package/CONTRACT.md +580 -0
- package/GEMINI.md +9 -0
- package/LICENSE +21 -0
- package/LICENSE-third-party +88 -0
- package/MIGRATION.md +312 -0
- package/README.md +380 -0
- package/ROADMAP.md +714 -0
- package/THEMING.md +290 -0
- package/THREE-TIERS.md +158 -0
- package/VERSIONING.md +200 -0
- package/_index.scss +34 -0
- package/api.scss +16 -0
- package/bin/README.md +57 -0
- package/bin/cia.cjs +114 -0
- package/bin/migrate-bootstrap.cjs +427 -0
- package/bin/migrate-tailwind.cjs +832 -0
- package/css-is-awesome.instructions.md +533 -0
- package/dist/css-is-awesome.core.css +598 -0
- package/dist/css-is-awesome.core.min.css +1 -0
- package/dist/css-is-awesome.css +3733 -0
- package/dist/css-is-awesome.min.css +1 -0
- package/dist/css-is-awesome.utilities.css +2445 -0
- package/dist/css-is-awesome.utilities.min.css +1 -0
- package/dist/tokens.css +508 -0
- package/dist/tokens.d.ts +266 -0
- package/dist/tokens.min.css +1 -0
- package/figma-tokens/README.md +57 -0
- package/figma-tokens/primitives-brand.scss +121 -0
- package/figma-tokens/semantic-dark.scss +61 -0
- package/figma-tokens/semantic-light.scss +61 -0
- package/figma-tokens/tokens.json +144 -0
- package/llm.txt +183 -0
- package/mcp/server.cjs +1495 -0
- package/package.json +199 -0
- package/public/icons/README.md +278 -0
- package/public/icons/arrow-right.svg +4 -0
- package/public/icons/check.svg +4 -0
- package/public/icons/chevron-down.svg +4 -0
- package/public/icons/close.svg +4 -0
- package/public/icons/core/arrow-down.svg +13 -0
- package/public/icons/core/arrow-left.svg +13 -0
- package/public/icons/core/arrow-right.svg +13 -0
- package/public/icons/core/arrow-up.svg +13 -0
- package/public/icons/core/bell.svg +13 -0
- package/public/icons/core/calendar.svg +15 -0
- package/public/icons/core/check.svg +12 -0
- package/public/icons/core/chevron-down.svg +12 -0
- package/public/icons/core/chevron-left.svg +12 -0
- package/public/icons/core/chevron-right.svg +12 -0
- package/public/icons/core/chevron-up.svg +12 -0
- package/public/icons/core/clock.svg +13 -0
- package/public/icons/core/close.svg +13 -0
- package/public/icons/core/copy.svg +13 -0
- package/public/icons/core/download.svg +14 -0
- package/public/icons/core/edit.svg +13 -0
- package/public/icons/core/error.svg +14 -0
- package/public/icons/core/external-link.svg +14 -0
- package/public/icons/core/eye-off.svg +15 -0
- package/public/icons/core/eye.svg +13 -0
- package/public/icons/core/filter.svg +12 -0
- package/public/icons/core/heart.svg +12 -0
- package/public/icons/core/help.svg +14 -0
- package/public/icons/core/home.svg +13 -0
- package/public/icons/core/info.svg +14 -0
- package/public/icons/core/loading.svg +12 -0
- package/public/icons/core/lock.svg +13 -0
- package/public/icons/core/mail.svg +13 -0
- package/public/icons/core/menu.svg +14 -0
- package/public/icons/core/message.svg +12 -0
- package/public/icons/core/minus.svg +12 -0
- package/public/icons/core/more-horizontal.svg +14 -0
- package/public/icons/core/pause.svg +13 -0
- package/public/icons/core/play.svg +12 -0
- package/public/icons/core/plus.svg +13 -0
- package/public/icons/core/refresh.svg +15 -0
- package/public/icons/core/save.svg +14 -0
- package/public/icons/core/search.svg +13 -0
- package/public/icons/core/settings.svg +13 -0
- package/public/icons/core/share.svg +14 -0
- package/public/icons/core/sort.svg +15 -0
- package/public/icons/core/star.svg +12 -0
- package/public/icons/core/success.svg +13 -0
- package/public/icons/core/trash.svg +16 -0
- package/public/icons/core/unlock.svg +13 -0
- package/public/icons/core/upload.svg +14 -0
- package/public/icons/core/user.svg +13 -0
- package/public/icons/core/users.svg +15 -0
- package/public/icons/core/warning.svg +14 -0
- package/public/icons/download.svg +4 -0
- package/public/icons/edit.svg +4 -0
- package/public/icons/menu.svg +4 -0
- package/public/icons/search.svg +4 -0
- package/public/theme.css +4179 -0
- package/public/themes/README.md +102 -0
- package/public/themes/boilerplate/theme.css +154 -0
- package/public/themes/boilerplate-dark/theme.css +171 -0
- package/public/themes/boilerplate-light/theme.css +171 -0
- package/public/themes/cupertino/theme.css +165 -0
- package/public/themes/cupertino-dark/theme.css +200 -0
- package/public/themes/cupertino-light/theme.css +227 -0
- package/public/themes/glass/theme.css +190 -0
- package/public/themes/glass-dark/theme.css +201 -0
- package/public/themes/glass-light/theme.css +229 -0
- package/public/themes/graphite/theme.css +155 -0
- package/public/themes/graphite-dark/theme.css +223 -0
- package/public/themes/graphite-light/theme.css +191 -0
- package/public/themes/press/theme.css +189 -0
- package/public/themes/press-dark/theme.css +199 -0
- package/public/themes/press-light/theme.css +235 -0
- package/public/themes/prism/theme.css +159 -0
- package/public/themes/prism-dark/theme.css +185 -0
- package/public/themes/prism-light/theme.css +188 -0
- package/public/themes/sketchbook/theme.css +152 -0
- package/public/themes/sketchbook-dark/theme.css +194 -0
- package/public/themes/sketchbook-light/theme.css +188 -0
- package/public/themes/terminal/theme.css +159 -0
- package/public/themes/terminal-dark/theme.css +229 -0
- package/public/themes/terminal-light/theme.css +152 -0
- package/scripts/README.md +70 -0
- package/scripts/icon-contract.json +67 -0
- package/scripts/icon-validator.js +205 -0
- package/scripts/prepare-dist.mjs +65 -0
- package/scripts/theme-a11y.js +415 -0
- package/scripts/theme-contract.json +171 -0
- package/scripts/theme-validator.js +674 -0
- package/scss/README.md +55 -0
- package/scss/_animations-utilities.scss +107 -0
- package/scss/_animations.scss +248 -0
- package/scss/_app-styles.scss +15 -0
- package/scss/_generator.scss +174 -0
- package/scss/_icons.scss +475 -0
- package/scss/_index.scss +17 -0
- package/scss/_layout.scss +597 -0
- package/scss/_mixins.scss +1036 -0
- package/scss/_system.scss +291 -0
- package/scss/_utilities.scss +377 -0
- package/scss/api.scss +61 -0
- package/scss/components/_accordion.scss +72 -0
- package/scss/components/_buttons.scss +171 -0
- package/scss/components/_copy-button.scss +69 -0
- package/scss/components/_data.scss +190 -0
- package/scss/components/_feedback.scss +197 -0
- package/scss/components/_forms.scss +272 -0
- package/scss/components/_index.scss +17 -0
- package/scss/components/_navigation.scss +186 -0
- package/scss/components/_overlay.scss +259 -0
- package/scss/components/_stepper.scss +159 -0
- package/scss/components/_tabs.scss +72 -0
- package/scss/core.scss +54 -0
- package/scss/examples/_theming.scss +107 -0
- package/scss/examples/_usage.scss +317 -0
- package/scss/main.scss +64 -0
- package/scss/recipes/README.md +110 -0
- package/scss/recipes/_bare-tags.scss +232 -0
- package/scss/recipes/_recipe-template.md +119 -0
- package/scss/recipes/combobox.md +509 -0
- package/scss/recipes/dialog.md +265 -0
- package/scss/recipes/print-to-pdf.md +263 -0
- package/scss/theme/README.md +67 -0
- package/scss/theme/_brand.scss +18 -0
- package/scss/theme/_colors-dark.scss +68 -0
- package/scss/theme/_colors-light.scss +70 -0
- package/scss/theme/_components.scss +94 -0
- package/scss/theme/_icons.scss +104 -0
- package/scss/theme/_index.scss +62 -0
- package/scss/theme/_shadows.scss +65 -0
- package/scss/theme/_shape.scss +13 -0
- package/scss/theme/_typography.scss +9 -0
- package/scss/theme/registry.json +447 -0
- package/scss/themes/boilerplate-dark.scss +212 -0
- package/scss/themes/boilerplate-light.scss +209 -0
- package/scss/themes/boilerplate.scss +181 -0
- package/scss/themes/cupertino-dark.scss +238 -0
- package/scss/themes/cupertino-light.scss +266 -0
- package/scss/themes/cupertino.scss +194 -0
- package/scss/themes/glass-dark.scss +238 -0
- package/scss/themes/glass-light.scss +266 -0
- package/scss/themes/glass.scss +220 -0
- package/scss/themes/graphite-dark.scss +260 -0
- package/scss/themes/graphite-light.scss +228 -0
- package/scss/themes/graphite.scss +182 -0
- package/scss/themes/press-dark.scss +237 -0
- package/scss/themes/press-light.scss +273 -0
- package/scss/themes/press.scss +241 -0
- package/scss/themes/prism-dark.scss +217 -0
- package/scss/themes/prism-light.scss +220 -0
- package/scss/themes/prism.scss +190 -0
- package/scss/themes/sketchbook-dark.scss +231 -0
- package/scss/themes/sketchbook-light.scss +231 -0
- package/scss/themes/sketchbook.scss +178 -0
- package/scss/themes/terminal-dark.scss +267 -0
- package/scss/themes/terminal-light.scss +175 -0
- package/scss/themes/terminal.scss +185 -0
- package/scss/tokens.scss +23 -0
- package/scss/utilities-only.scss +4 -0
package/scss/_icons.scss
ADDED
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// ICONS — Two Separate Systems (SVG + Font Awesome)
|
|
3
|
+
// ============================================================================
|
|
4
|
+
// This module ships two independent icon APIs. Use whichever fits — or both.
|
|
5
|
+
// They do NOT depend on each other.
|
|
6
|
+
//
|
|
7
|
+
// ----------------------------------------------------------------------------
|
|
8
|
+
// 1. SVG icons (folder-based, zero registration)
|
|
9
|
+
// ----------------------------------------------------------------------------
|
|
10
|
+
// `svg($name)` — inline icon rendered via CSS mask + currentColor.
|
|
11
|
+
// Single-color, reskins automatically with `color:`.
|
|
12
|
+
// `svg-bg($name)` — icon as `background-image`. Multi-color SVGs stay
|
|
13
|
+
// multi-color (no mask, no tint).
|
|
14
|
+
// `svg-text($name)` — icon + label in one element via ::before / ::after,
|
|
15
|
+
// with gap + before/after positioning.
|
|
16
|
+
//
|
|
17
|
+
// ----------------------------------------------------------------------------
|
|
18
|
+
// 2. Font Awesome icons (font-based)
|
|
19
|
+
// ----------------------------------------------------------------------------
|
|
20
|
+
// `fa-load` — @font-face declarations (call once if self-hosting).
|
|
21
|
+
// `fa($name)` — raw ::before/::after content (FA glyph + font).
|
|
22
|
+
// `fa-icon($name)` — standalone FA icon element.
|
|
23
|
+
// `fa-text($name)` — FA icon + label, same gap/position API as svg-text.
|
|
24
|
+
// `fa-spin($name)` — FA icon with a built-in spinner animation.
|
|
25
|
+
//
|
|
26
|
+
// ----------------------------------------------------------------------------
|
|
27
|
+
// Config points (all defined in `scss/theme/_icons.scss` and re-exported
|
|
28
|
+
// from `scss/theme/_index.scss` as `t.$theme-*`):
|
|
29
|
+
// ----------------------------------------------------------------------------
|
|
30
|
+
// $theme-icon-path — URL where SVGs live. Default: '/icons'.
|
|
31
|
+
// Themes can override to ship their own pack.
|
|
32
|
+
// $theme-icon-size — default icon dimension. Default: 24px.
|
|
33
|
+
// $theme-icon-svg-alias — map of semantic-name → file-name remaps,
|
|
34
|
+
// e.g. (delete: 'trash', close: 'x').
|
|
35
|
+
// $theme-fa-path — URL where FA woff2 files live. Default:
|
|
36
|
+
// '/webfonts'.
|
|
37
|
+
// $theme-fa-style — default FA family (solid|regular|light|
|
|
38
|
+
// thin|brands|duotone). Default: solid.
|
|
39
|
+
// $theme-fa-pro — flip to `true` if you've licensed Font
|
|
40
|
+
// Awesome 6 Pro. Adds Light / Thin / Duotone
|
|
41
|
+
// to fa-load and switches Solid / Regular to
|
|
42
|
+
// the "Font Awesome 6 Pro" family. Default:
|
|
43
|
+
// false (Free).
|
|
44
|
+
// $theme-icon-fa-map — map of semantic-name → FA unicode codepoint.
|
|
45
|
+
//
|
|
46
|
+
// ----------------------------------------------------------------------------
|
|
47
|
+
// currentColor behavior
|
|
48
|
+
// ----------------------------------------------------------------------------
|
|
49
|
+
// `svg` and `svg-text` paint via CSS mask + `background: currentColor`, so
|
|
50
|
+
// the icon inherits whatever `color:` is set on the element (or an ancestor).
|
|
51
|
+
// Set `color: red;` on the parent and the icon turns red. No extra CSS.
|
|
52
|
+
//
|
|
53
|
+
// `svg-bg` does NOT recolor — it renders the source SVG as-is. Use it when
|
|
54
|
+
// the SVG has multiple baked-in colors you want to preserve.
|
|
55
|
+
//
|
|
56
|
+
// ----------------------------------------------------------------------------
|
|
57
|
+
// Adding icons
|
|
58
|
+
// ----------------------------------------------------------------------------
|
|
59
|
+
// Drop an SVG into the `$theme-icon-path` folder. Filename becomes the name:
|
|
60
|
+
// `arrow-right.svg` → `@include m.svg(arrow-right);`. See the authoring
|
|
61
|
+
// guide at `public/icons/README.md` for sizing, coloring, aliases, and
|
|
62
|
+
// per-theme icon packs.
|
|
63
|
+
// ============================================================================
|
|
64
|
+
|
|
65
|
+
@use 'sass:map';
|
|
66
|
+
@use 'sass:list';
|
|
67
|
+
@use './theme' as t;
|
|
68
|
+
|
|
69
|
+
// ============================================================================
|
|
70
|
+
// SVG ICONS
|
|
71
|
+
// ============================================================================
|
|
72
|
+
// PACK-BASED: glyphs live at $theme-icon-path/$theme-icon-pack/<name>.svg.
|
|
73
|
+
// Default pack is `core` (vendored from Lucide). Drop additional SVGs into
|
|
74
|
+
// /icons/<pack>/ to add a new pack, or into the same `core` folder to add
|
|
75
|
+
// to the default pack.
|
|
76
|
+
//
|
|
77
|
+
// How `m.svg(name)` resolves at runtime:
|
|
78
|
+
//
|
|
79
|
+
// mask: var(--cia-icon-<name>, url('<core-pack-path>/<name>.svg'));
|
|
80
|
+
//
|
|
81
|
+
// 1. If a theme declares `--cia-icon-<name>: url(...)` on `:root`, the
|
|
82
|
+
// browser uses that override URL — that file lives at
|
|
83
|
+
// /themes/<theme-name>/icons/<pack>/<name>.svg by convention.
|
|
84
|
+
// 2. Else the browser falls back to the bundled core-pack URL.
|
|
85
|
+
// 3. If neither resolves, the browser 404s (graceful — the host element
|
|
86
|
+
// stays sized but renders empty).
|
|
87
|
+
//
|
|
88
|
+
// At compile time, an alias map ($theme-icon-svg-alias) lets call sites
|
|
89
|
+
// use semantic names (close, delete) that resolve to a different on-disk
|
|
90
|
+
// filename (x, trash). Aliases run BEFORE the override lookup so theme
|
|
91
|
+
// overrides key off the canonical filename, not the alias.
|
|
92
|
+
//
|
|
93
|
+
// To add icons: drop the .svg file in /icons/<pack>/. Done.
|
|
94
|
+
// To override an icon for one theme: drop a replacement at
|
|
95
|
+
// /themes/<theme>/icons/<pack>/<name>.svg AND declare the override
|
|
96
|
+
// custom property in that theme's theme.css. See CONTRACT.md →
|
|
97
|
+
// "Icons contract" for the full mechanism.
|
|
98
|
+
// ============================================================================
|
|
99
|
+
|
|
100
|
+
// ----------------------------------------------------------------------------
|
|
101
|
+
// _svg-file($name) — private helper
|
|
102
|
+
// Resolves a semantic name to an actual .svg filename by checking the
|
|
103
|
+
// alias map. If the name isn't aliased, the name itself is returned.
|
|
104
|
+
// _svg-file(delete) → 'trash' (via alias map)
|
|
105
|
+
// _svg-file(arrow) → arrow (pass-through)
|
|
106
|
+
// ----------------------------------------------------------------------------
|
|
107
|
+
@function _svg-file($name) {
|
|
108
|
+
$alias: map.get(t.$theme-icon-svg-alias, $name);
|
|
109
|
+
@if $alias {
|
|
110
|
+
@return $alias;
|
|
111
|
+
}
|
|
112
|
+
@return $name;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// ----------------------------------------------------------------------------
|
|
116
|
+
// _svg-url($name) — private helper
|
|
117
|
+
// Returns the unquoted CSS value used in mask / background. Emits a
|
|
118
|
+
// `var(--cia-icon-<file>, url('<base>/<file>.svg'))` so themes can
|
|
119
|
+
// override one glyph at a time by declaring the custom property without
|
|
120
|
+
// touching the rest of the pack.
|
|
121
|
+
// ----------------------------------------------------------------------------
|
|
122
|
+
@function _svg-url($name) {
|
|
123
|
+
$file: _svg-file($name);
|
|
124
|
+
$base: '#{t.$theme-icon-path}/#{t.$theme-icon-pack}';
|
|
125
|
+
@return var(
|
|
126
|
+
--cia-icon-#{$file},
|
|
127
|
+
url('#{$base}/#{$file}.svg')
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// ----------------------------------------------------------------------------
|
|
132
|
+
// @mixin svg($name, $size, $color)
|
|
133
|
+
// Renders a single-color SVG as an inline element using CSS mask +
|
|
134
|
+
// currentColor. The icon automatically reskins with the parent's `color`.
|
|
135
|
+
// Use this for icons that should tint with text color.
|
|
136
|
+
//
|
|
137
|
+
// Params:
|
|
138
|
+
// $name — icon name (matches `<name>.svg` in $theme-icon-path)
|
|
139
|
+
// $size — icon width/height (default: t.$theme-icon-size)
|
|
140
|
+
// $color — icon color (default: currentColor)
|
|
141
|
+
//
|
|
142
|
+
// Example:
|
|
143
|
+
// .btn-close { @include m.svg(close); color: var(--color-danger); }
|
|
144
|
+
// ----------------------------------------------------------------------------
|
|
145
|
+
@mixin svg(
|
|
146
|
+
$name,
|
|
147
|
+
$size: t.$theme-icon-size,
|
|
148
|
+
$color: currentColor
|
|
149
|
+
) {
|
|
150
|
+
$url: _svg-url($name);
|
|
151
|
+
|
|
152
|
+
display: inline-flex;
|
|
153
|
+
align-items: center;
|
|
154
|
+
justify-content: center;
|
|
155
|
+
width: $size;
|
|
156
|
+
height: $size;
|
|
157
|
+
color: $color;
|
|
158
|
+
|
|
159
|
+
&::before {
|
|
160
|
+
content: '';
|
|
161
|
+
display: block;
|
|
162
|
+
width: 100%;
|
|
163
|
+
height: 100%;
|
|
164
|
+
background: currentColor;
|
|
165
|
+
mask: $url center / contain no-repeat;
|
|
166
|
+
-webkit-mask: $url center / contain no-repeat;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// ----------------------------------------------------------------------------
|
|
171
|
+
// @mixin svg-bg($name, $size)
|
|
172
|
+
// Renders an SVG as a plain `background-image`. No mask, no recoloring —
|
|
173
|
+
// multi-color source SVGs render with their original palette. Use this for
|
|
174
|
+
// brand marks, illustrations, or any icon whose colors must stay baked in.
|
|
175
|
+
//
|
|
176
|
+
// Params:
|
|
177
|
+
// $name — icon name (matches `<name>.svg` in $theme-icon-path)
|
|
178
|
+
// $size — icon width/height (default: t.$theme-icon-size)
|
|
179
|
+
//
|
|
180
|
+
// Example:
|
|
181
|
+
// .logo { @include m.svg-bg(brand-mark, 48px); }
|
|
182
|
+
// ----------------------------------------------------------------------------
|
|
183
|
+
@mixin svg-bg(
|
|
184
|
+
$name,
|
|
185
|
+
$size: t.$theme-icon-size
|
|
186
|
+
) {
|
|
187
|
+
$url: _svg-url($name);
|
|
188
|
+
|
|
189
|
+
display: inline-block;
|
|
190
|
+
width: $size;
|
|
191
|
+
height: $size;
|
|
192
|
+
background: $url center / contain no-repeat;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// ----------------------------------------------------------------------------
|
|
196
|
+
// @mixin svg-text($name, $size, $gap, $position)
|
|
197
|
+
// Pairs an SVG icon with its parent's text content in a single flex row.
|
|
198
|
+
// The icon is drawn via ::before (default) or ::after, tinted by
|
|
199
|
+
// currentColor, and separated from the text by $gap.
|
|
200
|
+
//
|
|
201
|
+
// Params:
|
|
202
|
+
// $name — icon name
|
|
203
|
+
// $size — icon dimension (default: 1em, scales with font-size)
|
|
204
|
+
// $gap — space between icon and text (default: 0.5em)
|
|
205
|
+
// $position — `before` or `after` (default: before)
|
|
206
|
+
//
|
|
207
|
+
// Example:
|
|
208
|
+
// .btn-save { @include m.svg-text(check, 1em, 0.5em, before); }
|
|
209
|
+
// ----------------------------------------------------------------------------
|
|
210
|
+
@mixin svg-text(
|
|
211
|
+
$name,
|
|
212
|
+
$size: 1em,
|
|
213
|
+
$gap: 0.5em,
|
|
214
|
+
$position: before
|
|
215
|
+
) {
|
|
216
|
+
$url: _svg-url($name);
|
|
217
|
+
|
|
218
|
+
display: inline-flex;
|
|
219
|
+
align-items: center;
|
|
220
|
+
gap: $gap;
|
|
221
|
+
|
|
222
|
+
@if $position == after {
|
|
223
|
+
flex-direction: row-reverse;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
&::#{$position} {
|
|
227
|
+
content: '';
|
|
228
|
+
flex-shrink: 0;
|
|
229
|
+
width: $size;
|
|
230
|
+
height: $size;
|
|
231
|
+
background: currentColor;
|
|
232
|
+
mask: $url center / contain no-repeat;
|
|
233
|
+
-webkit-mask: $url center / contain no-repeat;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// ============================================================================
|
|
238
|
+
// FONT AWESOME ICONS
|
|
239
|
+
// ============================================================================
|
|
240
|
+
// Opt-in. Only use if your project is already on Font Awesome.
|
|
241
|
+
// Configure $theme-fa-path, $theme-icon-fa-map, and (for licensed users)
|
|
242
|
+
// $theme-fa-pro in scss/theme/_icons.scss.
|
|
243
|
+
// ============================================================================
|
|
244
|
+
|
|
245
|
+
// FA family config — maps a style name to (font-family, font-weight).
|
|
246
|
+
// Two maps: Free ships Solid + Regular + Brands; Pro adds Light + Thin +
|
|
247
|
+
// Duotone and renames Solid/Regular to the "Font Awesome 6 Pro" family.
|
|
248
|
+
// $_fa-styles is selected based on t.$theme-fa-pro.
|
|
249
|
+
$_fa-styles-free: (
|
|
250
|
+
solid: ('Font Awesome 6 Free', 900),
|
|
251
|
+
regular: ('Font Awesome 6 Free', 400),
|
|
252
|
+
brands: ('Font Awesome 6 Brands', 400),
|
|
253
|
+
);
|
|
254
|
+
|
|
255
|
+
$_fa-styles-pro: (
|
|
256
|
+
solid: ('Font Awesome 6 Pro', 900),
|
|
257
|
+
regular: ('Font Awesome 6 Pro', 400),
|
|
258
|
+
light: ('Font Awesome 6 Pro', 300),
|
|
259
|
+
thin: ('Font Awesome 6 Pro', 100),
|
|
260
|
+
brands: ('Font Awesome 6 Brands', 400),
|
|
261
|
+
duotone: ('Font Awesome 6 Duotone', 900),
|
|
262
|
+
);
|
|
263
|
+
|
|
264
|
+
@function _fa-styles($pro) {
|
|
265
|
+
@if $pro { @return $_fa-styles-pro; }
|
|
266
|
+
@return $_fa-styles-free;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
@function _fa-family($pro) {
|
|
270
|
+
@if $pro { @return 'Font Awesome 6 Pro'; }
|
|
271
|
+
@return 'Font Awesome 6 Free';
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
$_fa-styles: _fa-styles(t.$theme-fa-pro);
|
|
275
|
+
|
|
276
|
+
// ----------------------------------------------------------------------------
|
|
277
|
+
// @mixin fa-load($pro)
|
|
278
|
+
// Emits @font-face rules for self-hosted Font Awesome 6.
|
|
279
|
+
// Call this exactly once (e.g. in main.scss) if you ship FA woff2 files.
|
|
280
|
+
// Skip this mixin entirely if you load FA via their CDN/kit.
|
|
281
|
+
//
|
|
282
|
+
// Free (default): Solid + Regular + Brands.
|
|
283
|
+
// Pro: also Light + Thin + Duotone, with Solid / Regular
|
|
284
|
+
// switched to the "Font Awesome 6 Pro" family.
|
|
285
|
+
//
|
|
286
|
+
// To turn Pro on, set the global flag once and `fa-load` plus `fa()` both
|
|
287
|
+
// follow:
|
|
288
|
+
//
|
|
289
|
+
// @use 'css-is-awesome/scss/theme/icons' with ($fa-pro: true);
|
|
290
|
+
// @use 'css-is-awesome/scss/main';
|
|
291
|
+
// :root { @include m.fa-load; }
|
|
292
|
+
//
|
|
293
|
+
// The $pro parameter here is an escape hatch — useful if you only want to
|
|
294
|
+
// flip the @font-face emission (e.g. hybrid setups). Most projects should
|
|
295
|
+
// set the global so fa-load and fa() agree on the family map.
|
|
296
|
+
//
|
|
297
|
+
// Drop the woff2 files for the weights you ship at $theme-fa-path; missing
|
|
298
|
+
// files won't error, they just won't render until you add them.
|
|
299
|
+
// ----------------------------------------------------------------------------
|
|
300
|
+
@mixin fa-load($pro: t.$theme-fa-pro) {
|
|
301
|
+
$family: _fa-family($pro);
|
|
302
|
+
|
|
303
|
+
@font-face {
|
|
304
|
+
font-family: $family;
|
|
305
|
+
font-style: normal;
|
|
306
|
+
font-weight: 400;
|
|
307
|
+
font-display: block;
|
|
308
|
+
src: url('#{t.$theme-fa-path}/fa-regular-400.woff2') format('woff2');
|
|
309
|
+
}
|
|
310
|
+
@font-face {
|
|
311
|
+
font-family: $family;
|
|
312
|
+
font-style: normal;
|
|
313
|
+
font-weight: 900;
|
|
314
|
+
font-display: block;
|
|
315
|
+
src: url('#{t.$theme-fa-path}/fa-solid-900.woff2') format('woff2');
|
|
316
|
+
}
|
|
317
|
+
@font-face {
|
|
318
|
+
font-family: 'Font Awesome 6 Brands';
|
|
319
|
+
font-style: normal;
|
|
320
|
+
font-weight: 400;
|
|
321
|
+
font-display: block;
|
|
322
|
+
src: url('#{t.$theme-fa-path}/fa-brands-400.woff2') format('woff2');
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
@if $pro {
|
|
326
|
+
@font-face {
|
|
327
|
+
font-family: 'Font Awesome 6 Pro';
|
|
328
|
+
font-style: normal;
|
|
329
|
+
font-weight: 300;
|
|
330
|
+
font-display: block;
|
|
331
|
+
src: url('#{t.$theme-fa-path}/fa-light-300.woff2') format('woff2');
|
|
332
|
+
}
|
|
333
|
+
@font-face {
|
|
334
|
+
font-family: 'Font Awesome 6 Pro';
|
|
335
|
+
font-style: normal;
|
|
336
|
+
font-weight: 100;
|
|
337
|
+
font-display: block;
|
|
338
|
+
src: url('#{t.$theme-fa-path}/fa-thin-100.woff2') format('woff2');
|
|
339
|
+
}
|
|
340
|
+
@font-face {
|
|
341
|
+
font-family: 'Font Awesome 6 Duotone';
|
|
342
|
+
font-style: normal;
|
|
343
|
+
font-weight: 900;
|
|
344
|
+
font-display: block;
|
|
345
|
+
src: url('#{t.$theme-fa-path}/fa-duotone-900.woff2') format('woff2');
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// ----------------------------------------------------------------------------
|
|
351
|
+
// @mixin fa($name, $style, $size)
|
|
352
|
+
// Low-level primitive — emits the font-family/weight/content bundle for a
|
|
353
|
+
// Font Awesome glyph. MUST be placed inside a ::before or ::after rule
|
|
354
|
+
// because it sets `content:`. Most of the time you want `fa-icon` or
|
|
355
|
+
// `fa-text` instead.
|
|
356
|
+
//
|
|
357
|
+
// Params:
|
|
358
|
+
// $name — icon name from $theme-icon-fa-map, or a raw unicode string
|
|
359
|
+
// $style — solid|regular|light|thin|brands (default: t.$theme-fa-style)
|
|
360
|
+
// $size — optional font-size override
|
|
361
|
+
//
|
|
362
|
+
// Example:
|
|
363
|
+
// .alert::before { @include m.fa(warning, solid, 1.25em); }
|
|
364
|
+
// ----------------------------------------------------------------------------
|
|
365
|
+
@mixin fa(
|
|
366
|
+
$name,
|
|
367
|
+
$style: t.$theme-fa-style,
|
|
368
|
+
$size: null
|
|
369
|
+
) {
|
|
370
|
+
$code: map.get(t.$theme-icon-fa-map, $name) or $name;
|
|
371
|
+
$config: map.get($_fa-styles, $style);
|
|
372
|
+
|
|
373
|
+
font-family: list.nth($config, 1);
|
|
374
|
+
font-weight: list.nth($config, 2);
|
|
375
|
+
font-style: normal;
|
|
376
|
+
line-height: 1;
|
|
377
|
+
content: $code;
|
|
378
|
+
-webkit-font-smoothing: antialiased;
|
|
379
|
+
-moz-osx-font-smoothing: grayscale;
|
|
380
|
+
|
|
381
|
+
@if $size { font-size: $size; }
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
// ----------------------------------------------------------------------------
|
|
385
|
+
// @mixin fa-icon($name, $size, $style, $color)
|
|
386
|
+
// Standalone Font Awesome icon — sizes the host element, renders the glyph
|
|
387
|
+
// in ::before, and inherits currentColor by default. Counterpart to `svg`.
|
|
388
|
+
//
|
|
389
|
+
// Params:
|
|
390
|
+
// $name — icon name (from $theme-icon-fa-map)
|
|
391
|
+
// $size — icon width/height (default: t.$theme-icon-size)
|
|
392
|
+
// $style — solid|regular|light|thin|brands (default: t.$theme-fa-style)
|
|
393
|
+
// $color — icon color (default: currentColor)
|
|
394
|
+
//
|
|
395
|
+
// Example:
|
|
396
|
+
// .icon-search { @include m.fa-icon(search); }
|
|
397
|
+
// ----------------------------------------------------------------------------
|
|
398
|
+
@mixin fa-icon(
|
|
399
|
+
$name,
|
|
400
|
+
$size: t.$theme-icon-size,
|
|
401
|
+
$style: t.$theme-fa-style,
|
|
402
|
+
$color: currentColor
|
|
403
|
+
) {
|
|
404
|
+
display: inline-flex;
|
|
405
|
+
align-items: center;
|
|
406
|
+
justify-content: center;
|
|
407
|
+
width: $size;
|
|
408
|
+
height: $size;
|
|
409
|
+
color: $color;
|
|
410
|
+
|
|
411
|
+
&::before {
|
|
412
|
+
@include fa($name, $style, $size);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
// ----------------------------------------------------------------------------
|
|
417
|
+
// @mixin fa-text($name, $size, $gap, $style, $position)
|
|
418
|
+
// Font Awesome icon + text label in a flex row. Mirrors the svg-text API.
|
|
419
|
+
//
|
|
420
|
+
// Params:
|
|
421
|
+
// $name — icon name
|
|
422
|
+
// $size — icon dimension (default: 1em)
|
|
423
|
+
// $gap — space between icon and text (default: 0.5em)
|
|
424
|
+
// $style — FA family (default: t.$theme-fa-style)
|
|
425
|
+
// $position — `before` or `after` (default: before)
|
|
426
|
+
//
|
|
427
|
+
// Example:
|
|
428
|
+
// .btn-download { @include m.fa-text(download); }
|
|
429
|
+
// ----------------------------------------------------------------------------
|
|
430
|
+
@mixin fa-text(
|
|
431
|
+
$name,
|
|
432
|
+
$size: 1em,
|
|
433
|
+
$gap: 0.5em,
|
|
434
|
+
$style: t.$theme-fa-style,
|
|
435
|
+
$position: before
|
|
436
|
+
) {
|
|
437
|
+
display: inline-flex;
|
|
438
|
+
align-items: center;
|
|
439
|
+
gap: $gap;
|
|
440
|
+
|
|
441
|
+
@if $position == after {
|
|
442
|
+
flex-direction: row-reverse;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
&::#{$position} {
|
|
446
|
+
@include fa($name, $style, $size);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// ----------------------------------------------------------------------------
|
|
451
|
+
// @mixin fa-spin($name, $size, $style)
|
|
452
|
+
// Font Awesome icon with a built-in 1s linear infinite rotation. Use for
|
|
453
|
+
// loading spinners. Injects an @keyframes `fa-spin` at the root once.
|
|
454
|
+
//
|
|
455
|
+
// Params:
|
|
456
|
+
// $name — icon name (typically `spinner` or `refresh`)
|
|
457
|
+
// $size — icon dimension (default: t.$theme-icon-size)
|
|
458
|
+
// $style — FA family (default: t.$theme-fa-style)
|
|
459
|
+
//
|
|
460
|
+
// Example:
|
|
461
|
+
// .loader { @include m.fa-spin(spinner); }
|
|
462
|
+
// ----------------------------------------------------------------------------
|
|
463
|
+
@mixin fa-spin($name, $size: t.$theme-icon-size, $style: t.$theme-fa-style) {
|
|
464
|
+
@include fa-icon($name, $size, $style);
|
|
465
|
+
|
|
466
|
+
&::before {
|
|
467
|
+
animation: fa-spin 1s linear infinite;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
@at-root {
|
|
471
|
+
@keyframes fa-spin {
|
|
472
|
+
to { transform: rotate(360deg); }
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
package/scss/_index.scss
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// INDEX - Full Barrel (authoring API + global animation utilities)
|
|
3
|
+
// ============================================================================
|
|
4
|
+
// Kitchen-sink barrel: the zero-emit authoring API (defined in `api.scss`)
|
|
5
|
+
// PLUS the global animation utility classes + keyframes + reduced-motion
|
|
6
|
+
// safety net, which DO emit CSS.
|
|
7
|
+
//
|
|
8
|
+
// For a component-safe, ZERO-EMIT import (the common case, safe inside a
|
|
9
|
+
// `.module.scss`), use `css-is-awesome/api` instead — see `api.scss`.
|
|
10
|
+
//
|
|
11
|
+
// The authoring surface (mixins/functions/token maps) is defined ONCE in
|
|
12
|
+
// `api.scss`; this file only adds the emitting utilities on top, so the two
|
|
13
|
+
// barrels can never drift.
|
|
14
|
+
// ============================================================================
|
|
15
|
+
|
|
16
|
+
@forward 'api';
|
|
17
|
+
@forward './animations-utilities'; // Keyframes + .cia-anim-* + global reduced-motion safety net
|