nk_jtb 0.20.0 → 0.22.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/.github/copilot-instructions.md +71 -0
- package/.stylelintrc.json +16 -15
- package/dev.html +4 -4
- package/docs/animation.md +131 -0
- package/docs/api/architecture-naming.md +79 -0
- package/docs/api/build-classes.md +108 -0
- package/docs/api/make-from-breakpoint.md +52 -0
- package/docs/api/make-on-breakpoint.md +52 -0
- package/docs/api/make-position-based-class.md +83 -0
- package/docs/api/make-single-property-class.md +79 -0
- package/docs/api/make-themes.md +55 -0
- package/docs/api/make-to-breakpoint.md +52 -0
- package/docs/api/makers.md +15 -0
- package/docs/api/workflow.md +126 -0
- package/docs/automatic-spacing.md +97 -0
- package/docs/color-and-themes.md +104 -0
- package/docs/components/accordion.md +198 -0
- package/docs/components/button.md +55 -0
- package/docs/components/forms.md +282 -0
- package/docs/components/table.md +130 -0
- package/docs/conventions.md +205 -0
- package/docs/core-architecture.md +114 -0
- package/docs/display-and-visibility.md +56 -0
- package/docs/examples/form-examples.md +300 -0
- package/docs/examples/layout-dashboard.md +142 -0
- package/docs/examples/navbar.md +52 -0
- package/docs/examples/navigation.md +0 -0
- package/docs/examples/page-layouts-and-structures.md +153 -0
- package/docs/examples/ui-elements.md +147 -0
- package/docs/faqs.md +25 -0
- package/docs/installation.md +58 -0
- package/docs/introduction.md +146 -0
- package/docs/magic-classes.md +137 -0
- package/docs/navigation/example-navigations.md +19 -0
- package/docs/navigation/menu.md +215 -0
- package/docs/navigation/navbar.md +123 -0
- package/docs/navigation/overview.md +98 -0
- package/docs/navigation/pagination.md +90 -0
- package/docs/responsive-design.md +185 -0
- package/docs/responsive-testing.md +447 -0
- package/docs/utilities/animation.md +131 -0
- package/docs/utilities/border.md +229 -0
- package/docs/utilities/display-and-visibility.md +56 -0
- package/docs/utilities/effects.md +28 -0
- package/docs/wip.md +447 -0
- package/index.html +42 -1229
- package/js/markdown-loader.js +27 -0
- package/js/markdown-renderer.js +122 -0
- package/js/nav.json +154 -0
- package/js/navigation.js +65 -0
- package/jtb-for review/alignment.md +36 -0
- package/jtb-for review/aria.md +192 -0
- package/{directory-structure.md → jtb-for review/directory-structure.md } +140 -140
- package/jtb-for review/margin-padding-spacing.md +86 -0
- package/{resolvers.md → jtb-for review/resolvers.md } +91 -91
- package/jtb-for review/state-management.md +80 -0
- package/jtb-for review/utility-and-class-generation.md +942 -0
- package/main.js +21 -5
- package/package.json +8 -3
- package/prompt.md +2 -0
- package/public/images/favicon.svg +1 -1
- package/public/images/logo.svg +1 -1
- package/public/images/svg/jtb-icon.svg +9 -0
- package/public/svg/blur-red.svg +12 -12
- package/public/svg/blur.svg +1 -1
- package/public/svg/icons.svg +40 -0
- package/readme.md +20 -19
- package/src/base/_auto-spacing.scss +44 -0
- package/src/base/_base.scss +202 -235
- package/src/base/_list.scss +22 -18
- package/src/base/_root.scss +113 -8
- package/src/base/_table.scss +28 -0
- package/src/base/_typography.scss +31 -20
- package/src/base/index.scss +6 -5
- package/src/build.scss +6 -8
- package/src/common-tools.scss +12 -11
- package/src/components/_accordion.scss +94 -102
- package/src/components/_banner.scss +17 -17
- package/src/components/_box.scss +21 -28
- package/src/components/_button.scss +29 -20
- package/src/components/_dropdown.scss +46 -28
- package/src/components/_icon.scss +15 -25
- package/src/components/_list.scss +31 -31
- package/src/components/_loaders-and-spinners.scss +58 -0
- package/src/components/_menu.scss +89 -65
- package/src/components/_navbar.scss +26 -76
- package/src/components/_other.scss +29 -14
- package/src/components/_tabs.scss +37 -28
- package/src/components/index.scss +11 -10
- package/src/extras/_hero.scss +34 -34
- package/src/extras/_nk-app.scss +83 -55
- package/src/extras/_nk-docs.scss +266 -189
- package/src/extras/choices.scss +410 -410
- package/src/forms/_control.scss +50 -57
- package/src/forms/_file.scss +19 -20
- package/src/forms/_form.scss +90 -115
- package/src/forms/_toggle.scss +89 -78
- package/src/forms/index.scss +3 -3
- package/src/functions/_classes.scss +240 -119
- package/src/functions/_color-functions.scss +34 -28
- package/src/functions/_helpers.scss +12 -7
- package/src/functions/_map-and-list-helpers.scss +161 -166
- package/src/functions/_normalise-config.scss +55 -0
- package/src/functions/_strings.scss +164 -132
- package/src/maps_and_variables/_base.scss +47 -46
- package/src/maps_and_variables/_colors.scss +37 -23
- package/src/maps_and_variables/_components.scss +148 -76
- package/src/maps_and_variables/_config.scss +99 -31
- package/src/maps_and_variables/{_form-controls.scss → _forms.scss} +13 -15
- package/src/maps_and_variables/_property-maps.scss +44 -81
- package/src/maps_and_variables/_typography.scss +23 -10
- package/src/maps_and_variables/_value-maps.scss +178 -0
- package/src/maps_and_variables/index.scss +8 -12
- package/src/mixins/_backgrounds.scss +25 -0
- package/src/mixins/_build-classes.scss +197 -12
- package/src/mixins/_build-magic-classes.scss +113 -106
- package/src/mixins/_build-magic-grid.scss +89 -89
- package/src/mixins/_gradients.scss +82 -0
- package/src/mixins/_make-classes-old.scss +279 -0
- package/src/mixins/_make-classes.scss +187 -238
- package/src/mixins/_make-properties.scss +35 -0
- package/src/mixins/_media-container-queries.scss +200 -0
- package/src/mixins/_state.scss +44 -0
- package/src/mixins/_themes.scss +52 -0
- package/src/mixins/_transition.scss +88 -0
- package/src/play.scss +33 -1
- package/src/tests.scss +102 -0
- package/src/utilities/_alignment.scss +68 -61
- package/src/utilities/_animation.scss +177 -0
- package/src/utilities/_backgrounds.scss +12 -23
- package/src/utilities/_border.scss +12 -12
- package/src/utilities/_container.scss +15 -15
- package/src/utilities/_display-visibility.scss +42 -9
- package/src/utilities/_effects.scss +23 -3
- package/src/utilities/_flexbox.scss +58 -78
- package/src/utilities/_gradients.scss +57 -0
- package/src/utilities/_grid.scss +21 -51
- package/src/utilities/_interactivity.scss +15 -15
- package/src/utilities/_layout.scss +21 -21
- package/src/utilities/_misc.scss +95 -134
- package/src/utilities/_sizing.scss +18 -16
- package/src/utilities/_spacing.scss +61 -8
- package/src/utilities/_state.scss +80 -0
- package/src/utilities/_themes.scss +24 -15
- package/src/utilities/_transforms.scss +62 -32
- package/src/utilities/_transition.scss +48 -11
- package/src/utilities/_typography.scss +105 -51
- package/tw.html +16 -0
- package/vite.config.js +22 -7
- package/.vscode/settings.json +0 -3
- package/dev1.html +0 -18
- package/dev2.html +0 -18
- package/flexbox.html +0 -723
- package/layout-examples.html +0 -44
- package/public/svg/naykel-ui.svg +0 -1
- package/src/base/_content_gap.scss +0 -47
- package/src/maps_and_variables/_layout.scss +0 -21
- package/src/maps_and_variables/_position-maps.scss +0 -62
- package/src/maps_and_variables/_utility-maps.scss +0 -70
- package/src/maps_and_variables/_values-variants-and-properties.scss +0 -43
- package/src/mixins/_build-themes.scss +0 -22
- package/src/mixins/_media.scss +0 -104
- package/src/mixins/_property-makers.scss +0 -74
- package/src/mixins/_theme-makers.scss +0 -11
- package/src/utilities/_color.scss +0 -27
- package/tmp427/_state.scss +0 -20
- package/tmp427/_typography.scss +0 -36
- package/tmp427/_utils-to-add.scss +0 -64
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Copilot Instructions for JTB (Just the Basics)
|
|
2
|
+
|
|
3
|
+
## Project Overview
|
|
4
|
+
- **JTB** is a Sass-based utility framework focused on composable classes, minimal components, and predictable naming. It avoids runtime JavaScript and prioritizes build-time CSS generation.
|
|
5
|
+
- The architecture centers on SCSS mixins for class generation, using configuration maps and builder/maker mixins.
|
|
6
|
+
|
|
7
|
+
- This framework uses tailwind-like class, but is not tailwind.
|
|
8
|
+
- Read the conventions in `docs/conventions.md` for naming patterns and class structures.
|
|
9
|
+
|
|
10
|
+
## Key Files & Structure
|
|
11
|
+
- `src/` — Main SCSS source. Organized by `base/`, `components/`, `forms/`, `functions/`, `maps_and_variables/`, `mixins/`, `utilities/`.
|
|
12
|
+
- `build.scss` — Entry point for building the full framework.
|
|
13
|
+
- `docs/` — Documentation, conventions, and architecture explanations.
|
|
14
|
+
- `examples/` — Examples are provided in the documents not the examples/ folder.
|
|
15
|
+
- `package.json` — Build/test/lint scripts and dependencies.
|
|
16
|
+
|
|
17
|
+
## Before Responding
|
|
18
|
+
- Always consider existing patterns in the codebase
|
|
19
|
+
- Reference docs/ when explaining architecture
|
|
20
|
+
- Don't give generic CSS advice—this is a framework with specific conventions
|
|
21
|
+
|
|
22
|
+
For more details, see:
|
|
23
|
+
- `docs/core-architecture.md`
|
|
24
|
+
- `docs/conventions.md`
|
|
25
|
+
- `docs/responsive-design.md`
|
|
26
|
+
- `README.md`
|
|
27
|
+
|
|
28
|
+
## Class Generation Patterns
|
|
29
|
+
- **Builders**: Use configuration maps to generate sets of utility classes. Example:
|
|
30
|
+
```scss
|
|
31
|
+
@include build-classes((margin: (prefix: 'm-', values: (1,2,3), unit: 'rem')));
|
|
32
|
+
// Generates: .m-1, .m-2, .m-3
|
|
33
|
+
```
|
|
34
|
+
- **Makers**: For single, precise classes. Example:
|
|
35
|
+
```scss
|
|
36
|
+
@include make-single-property-class('display', 'hidden', 'none', $breakpoints: (md, lg), $states: (hover));
|
|
37
|
+
// Generates: .hidden, .md:hidden, .lg:hidden, .hover:hidden:hover
|
|
38
|
+
```
|
|
39
|
+
- **Responsive Prefixes**: `md:`, `on-md:`, `to-md:` control when styles apply. See `docs/responsive-design.md` for details.
|
|
40
|
+
|
|
41
|
+
## Naming Conventions
|
|
42
|
+
- Utility classes: `{breakpoint}:{property}-{variant/value}`
|
|
43
|
+
- Examples: `mxy`, `gap-lg`, `md:mxy-3`, `on-lg:hidden`
|
|
44
|
+
- Properties use short prefixes: `m` (margin), `p` (padding), `bg` (background), `txt` (text)
|
|
45
|
+
- Variants: Semantic keywords (`sm`, `lg`) or direct values (`1.5`, `0`)
|
|
46
|
+
|
|
47
|
+
## Developer Workflows
|
|
48
|
+
- **Build**: `npm run build` (uses Vite)
|
|
49
|
+
- **Dev**: `npm run dev` (hot reload, watches SCSS)
|
|
50
|
+
- **Watch**: `npm run watch` (watches build.scss)
|
|
51
|
+
- **Lint**: `npm run lint` or `npm run lint:base` (uses stylelint)
|
|
52
|
+
- **Playground**: `npm run play` (watches play.scss, opens files)
|
|
53
|
+
- **Debug**: `npm run debug` (Vite debug mode)
|
|
54
|
+
|
|
55
|
+
## Customization & Configuration
|
|
56
|
+
- Override variables in `maps_and_variables/` before importing modules.
|
|
57
|
+
- Import only needed modules for smaller builds.
|
|
58
|
+
- Vite config for SCSS: see `docs/installation.md` for `additionalData` usage.
|
|
59
|
+
|
|
60
|
+
## Integration Points
|
|
61
|
+
- Minimal JS: Only for interactive components (see `public/docs/components/` and dependencies in `package.json`).
|
|
62
|
+
- External: Uses Alpine.js for some components, Highlight.js and Marked for docs/examples.
|
|
63
|
+
|
|
64
|
+
## Project-Specific Patterns
|
|
65
|
+
- **No runtime CSS-in-JS.** All class generation is build-time via SCSS.
|
|
66
|
+
- **Responsive system**: Three prefix types for breakpoints (`md:`, `on-md:`, `to-md:`).
|
|
67
|
+
- **Spacing scale**: See `README.md` for px/rem mapping.
|
|
68
|
+
- **Class name prediction**: See `docs/conventions.md` for structure and examples.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
package/.stylelintrc.json
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "stylelint-config-standard-scss",
|
|
3
|
-
"plugins": [
|
|
4
|
-
"stylelint-order"
|
|
5
|
-
],
|
|
6
|
-
"ignoreFiles": [
|
|
7
|
-
"dist/**/*",
|
|
8
|
-
"**/*.min.css"
|
|
9
|
-
],
|
|
10
|
-
"rules": {
|
|
11
|
-
"scss/comment-no-empty": null,
|
|
12
|
-
"order/properties-alphabetical-order": true,
|
|
13
|
-
"scss/dollar-variable-colon-space-after": "always",
|
|
14
|
-
"scss/dollar-variable-empty-line-before": null
|
|
15
|
-
|
|
1
|
+
{
|
|
2
|
+
"extends": "stylelint-config-standard-scss",
|
|
3
|
+
"plugins": [
|
|
4
|
+
"stylelint-order"
|
|
5
|
+
],
|
|
6
|
+
"ignoreFiles": [
|
|
7
|
+
"dist/**/*",
|
|
8
|
+
"**/*.min.css"
|
|
9
|
+
],
|
|
10
|
+
"rules": {
|
|
11
|
+
"scss/comment-no-empty": null,
|
|
12
|
+
"order/properties-alphabetical-order": true,
|
|
13
|
+
"scss/dollar-variable-colon-space-after": "always",
|
|
14
|
+
"scss/dollar-variable-empty-line-before": null,
|
|
15
|
+
"hue-degree-notation": null
|
|
16
|
+
}
|
|
16
17
|
}
|
package/dev.html
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<link rel="icon" type="image/svg+xml" href="/images/favicon.svg" />
|
|
8
8
|
<title>DEV</title>
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
<!-- order matters, make sure the plugin comes before alpine.js -->
|
|
10
|
+
<script defer src="https://cdn.jsdelivr.net/npm/@alpinejs/collapse@3.x.x/dist/cdn.min.js"></script>
|
|
11
|
+
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
|
|
11
12
|
</head>
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
<body class="container py-5">
|
|
14
|
+
<body class="container py-5 bg-gray-200">
|
|
15
15
|
|
|
16
16
|
<script type="module" src="/main.js"></script>
|
|
17
17
|
</body>
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Animation Utilities
|
|
2
|
+
|
|
3
|
+
<h2>Loading States</h2>
|
|
4
|
+
<div class="grid md:cols-2 lg:cols-3 gap">
|
|
5
|
+
<!-- Simple Spinner -->
|
|
6
|
+
<div class="bx bdr-none shadow-lg flex-centered flex-col gap">
|
|
7
|
+
<h3 class="bx-title txt-1 font-semibold">Simple Spinner</h3>
|
|
8
|
+
<div class="animate-spin rounded-full wh-4 bdr-4 bdr-gray-200 bdr-t-blue-600"></div>
|
|
9
|
+
<p class="txt-sm txt-gray-600">Sending message...</p>
|
|
10
|
+
</div>
|
|
11
|
+
<!-- Ring Spinner (Thicker) -->
|
|
12
|
+
<div class="bx bdr-none shadow-lg flex-centered flex-col gap">
|
|
13
|
+
<h3 class="bx-title txt-1 font-semibold">Ring Spinner</h3>
|
|
14
|
+
<div class="animate-spin rounded-full wh-4 bdr-8 bdr-gray-200 bdr-t-indigo-600"></div>
|
|
15
|
+
<p class="txt-sm txt-gray-600">Processing...</p>
|
|
16
|
+
</div>
|
|
17
|
+
<!-- Dual Ring -->
|
|
18
|
+
<div class="bx bdr-none shadow-lg flex-centered flex-col gap">
|
|
19
|
+
<h3 class="bx-title txt-1 font-semibold">Dual Ring</h3>
|
|
20
|
+
<div class="relative">
|
|
21
|
+
<div class="animate-spin rounded-full wh-4 bdr-4 bdr-gray-200 bdr-t-purple-600"></div>
|
|
22
|
+
<div class="absolute top-05 left-05 animate-spin rounded-full wh-3 bdr-4 bdr-gray-100 bdr-t-purple-400" style="animation-direction: reverse;"></div>
|
|
23
|
+
</div>
|
|
24
|
+
<p class="txt-sm txt-gray-600">Loading...</p>
|
|
25
|
+
</div>
|
|
26
|
+
<!-- Bouncing Dots -->
|
|
27
|
+
<div class="bx bdr-none shadow-lg flex-centered flex-col gap">
|
|
28
|
+
<h3 class="bx-title txt-1 font-semibold">Bouncing Dots</h3>
|
|
29
|
+
<div class="flex space-x-05">
|
|
30
|
+
<div class="wh-1 bg-blue-600 rounded-full animate-bounce" style="animation-delay: 0s;"></div>
|
|
31
|
+
<div class="wh-1 bg-blue-600 rounded-full animate-bounce" style="animation-delay: 0.1s;"></div>
|
|
32
|
+
<div class="wh-1 bg-blue-600 rounded-full animate-bounce" style="animation-delay: 0.2s;"></div>
|
|
33
|
+
</div>
|
|
34
|
+
<p class="txt-sm txt-gray-600">Submitting...</p>
|
|
35
|
+
</div>
|
|
36
|
+
<!-- Pulsing Circle -->
|
|
37
|
+
<div class="bx bdr-none shadow-lg flex-centered flex-col gap">
|
|
38
|
+
<h3 class="bx-title txt-1 font-semibold">Pulse</h3>
|
|
39
|
+
<div class="wh-4 bg-teal-500 rounded-full animate-pulse"></div>
|
|
40
|
+
<p class="txt-sm txt-gray-600">Please wait...</p>
|
|
41
|
+
</div>
|
|
42
|
+
<!-- Pulse Rings -->
|
|
43
|
+
<div class="bx bdr-none shadow-lg flex-centered flex-col gap">
|
|
44
|
+
<h3 class="bx-title txt-1 font-semibold">Pulse Rings</h3>
|
|
45
|
+
<div class="relative">
|
|
46
|
+
<div class="wh-4 bg-emerald-500 rounded-full"></div>
|
|
47
|
+
<div class="absolute top-0 left-0 wh-4 bg-emerald-400 rounded-full animate-pulse-ring"></div>
|
|
48
|
+
<div class="absolute top-0 left-0 wh-4 bg-emerald-400 rounded-full animate-pulse-ring" style="animation-delay: 0.5s;"></div>
|
|
49
|
+
</div>
|
|
50
|
+
<p class="txt-sm txt-gray-600">Processing...</p>
|
|
51
|
+
</div>
|
|
52
|
+
<!-- SVG Spinner -->
|
|
53
|
+
<div class="bx bdr-none shadow-lg flex-centered flex-col gap">
|
|
54
|
+
<h3 class="bx-title txt-1 font-semibold">SVG Spinner</h3>
|
|
55
|
+
<svg class="animate-spin wh-4 txt-orange-600" fill="none" viewBox="0 0 24 24">
|
|
56
|
+
<circle class="opacity-30" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
|
57
|
+
<path class="opacity-80" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
|
|
58
|
+
</svg>
|
|
59
|
+
<p class="txt-sm txt-gray-600">Uploading...</p>
|
|
60
|
+
</div>
|
|
61
|
+
<!-- Progress Bar -->
|
|
62
|
+
<div class="bx bdr-none shadow-lg flex-centered flex-col gap">
|
|
63
|
+
<h3 class="bx-title txt-1 font-semibold">Progress Bar</h3>
|
|
64
|
+
<div class="w-full h-2 bg-gray-200 rounded-full overflow-hidden">
|
|
65
|
+
<div class="h-full bg-blue-600 rounded-full animate-pulse" style="width: 70%;"></div>
|
|
66
|
+
</div>
|
|
67
|
+
<p class="txt-sm txt-gray-600">70% Complete</p>
|
|
68
|
+
</div>
|
|
69
|
+
<!-- Sequential Dots -->
|
|
70
|
+
<div class="bx bdr-none shadow-lg flex-centered flex-col gap">
|
|
71
|
+
<h3 class="bx-title txt-1 font-semibold">Sequential Dots</h3>
|
|
72
|
+
<div class="flex space-x-05 items-center h-2">
|
|
73
|
+
<div class="wh-05 bg-gray-600 rounded-full opacity-0 animate-pulse" style="animation-delay: 0s;"></div>
|
|
74
|
+
<div class="wh-05 bg-gray-600 rounded-full opacity-0 animate-pulse" style="animation-delay: 0.3s;"></div>
|
|
75
|
+
<div class="wh-05 bg-gray-600 rounded-full opacity-0 animate-pulse" style="animation-delay: 0.6s;"></div>
|
|
76
|
+
</div>
|
|
77
|
+
<p class="txt-sm txt-gray-600">Loading...</p>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
## Loading Animations
|
|
82
|
+
|
|
83
|
+
<div class="loader-container bx dark">
|
|
84
|
+
<div class="spinner"></div>
|
|
85
|
+
<div class="loading-text">Loading<span class="dots"></span></div>
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
<div class="loader-container bx dark">
|
|
89
|
+
<div class="loading-text">Loading<span class="dots"></span></div>
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
## SVG Spinners
|
|
94
|
+
|
|
95
|
+
<div class="bx flex va-c">
|
|
96
|
+
<svg class="wh-2 animate-spin" viewBox="0 0 200 200">
|
|
97
|
+
<circle cx="100" cy="100" r="80" fill="none" class="stroke-gray-400" stroke-width="12" />
|
|
98
|
+
<circle cx="100" cy="100" r="80" fill="none" class="stroke-gray-100" stroke-width="12" stroke-linecap="round" stroke-dasharray="251.2" stroke-dashoffset="188.4" />
|
|
99
|
+
</svg>
|
|
100
|
+
<svg class="wh-3 animate-spin" viewBox="0 0 200 200">
|
|
101
|
+
<circle cx="100" cy="100" r="80" fill="none" class="stroke-red-300" stroke-width="12" />
|
|
102
|
+
<circle cx="100" cy="100" r="80" fill="none" class="stroke-blue-500" stroke-width="12" stroke-linecap="round" stroke-dasharray="251.2" stroke-dashoffset="188.4" />
|
|
103
|
+
</svg>
|
|
104
|
+
<svg class="wh-4 animate-spin" viewBox="0 0 200 200">
|
|
105
|
+
<circle cx="100" cy="100" r="80" fill="none" class="stroke-yellow-300" stroke-width="12" />
|
|
106
|
+
<circle cx="100" cy="100" r="80" fill="none" class="stroke-green-500" stroke-width="12" stroke-linecap="round" stroke-dasharray="251.2" stroke-dashoffset="188.4" />
|
|
107
|
+
</svg>
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
## Border Animations
|
|
112
|
+
|
|
113
|
+
### Spinner
|
|
114
|
+
|
|
115
|
+
```html +code +preview +collapse
|
|
116
|
+
<div class="dark flex-centered gap bx">
|
|
117
|
+
<div class="spinner sm"></div>
|
|
118
|
+
<div class="spinner"></div>
|
|
119
|
+
<div class="spinner lg"></div>
|
|
120
|
+
</div>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Thick Spinners:**
|
|
124
|
+
|
|
125
|
+
```html +code +preview +collapse
|
|
126
|
+
<div class="dark flex-centered gap bx">
|
|
127
|
+
<div class="spinner sm thick"></div>
|
|
128
|
+
<div class="spinner thick "></div>
|
|
129
|
+
<div class="spinner lg thick"></div>
|
|
130
|
+
</div>
|
|
131
|
+
```
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Mixin Architecture & Naming Conventions
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Architecture Levels
|
|
6
|
+
|
|
7
|
+
## The 4 Layers
|
|
8
|
+
|
|
9
|
+
**Layer 1: Base**
|
|
10
|
+
Foundation classes without breakpoints or states. Lowest priority in cascade.
|
|
11
|
+
|
|
12
|
+
**Layer 2: Responsive**
|
|
13
|
+
Media query variants that override base at different breakpoints (md:, lg:, etc).
|
|
14
|
+
|
|
15
|
+
**Layer 3: State**
|
|
16
|
+
Interaction state variants (hover:, focus:, active:) that override responsive.
|
|
17
|
+
|
|
18
|
+
**Layer 4: Responsive + State**
|
|
19
|
+
Combined breakpoint and state variants (md:hover:, lg:focus:, etc). Highest priority.
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
Based on the pattern, here's my recommendation:
|
|
35
|
+
|
|
36
|
+
## Naming Convention: **class** vs **variant**
|
|
37
|
+
|
|
38
|
+
- **`make-base-class()`** — Generates THE class (foundation, layer 1 only)
|
|
39
|
+
- **`make-responsive-variant()`** — Generates variants OF that class (layer 2)
|
|
40
|
+
- **`make-state-variant()`** — Generates variants OF that class (layer 3)
|
|
41
|
+
- **`make-responsive-state-variant()`** — Generates variants OF that class (layer 4)
|
|
42
|
+
|
|
43
|
+
And for position-based:
|
|
44
|
+
- **`make-responsive-position-variant()`** — Responsive variants (layer 2)
|
|
45
|
+
- **`make-state-position-variant()`** — State variants (layer 3)
|
|
46
|
+
- **`make-responsive-state-position-variant()`** — Both (layer 4)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## Data Flow
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
User Config (property map)
|
|
54
|
+
↓
|
|
55
|
+
build-classes-new (normalize config)
|
|
56
|
+
↓
|
|
57
|
+
build-base-layer (loop through values)
|
|
58
|
+
↓
|
|
59
|
+
make-base-class (generate CSS for one class)
|
|
60
|
+
↓
|
|
61
|
+
Final CSS Output
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
## Layer Order (Cascade Priority)
|
|
68
|
+
|
|
69
|
+
1. **Base Layer** → Lowest priority, establishes defaults
|
|
70
|
+
2. **Responsive Layer** → Overrides base at screen sizes
|
|
71
|
+
3. **State Layer** → Interactive states (hover, focus)
|
|
72
|
+
4. **Responsive+State Layer** → Highest priority, combined variants
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# build-classes()
|
|
2
|
+
|
|
3
|
+
## Signature
|
|
4
|
+
|
|
5
|
+
```scss +code
|
|
6
|
+
@mixin build-classes(
|
|
7
|
+
$properties-map,
|
|
8
|
+
$responsive: false,
|
|
9
|
+
$with-state: false,
|
|
10
|
+
$debug: false
|
|
11
|
+
)
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Parameters
|
|
15
|
+
|
|
16
|
+
| Parameter | Type | Default | Description |
|
|
17
|
+
| ----------------- | ------- | ------- | ---------------------------------------------------------------------------------- |
|
|
18
|
+
| `$properties-map` | Map | — | CSS property config with `prefix`, `values`, `unit`, `positions`, `omit-axis-keys` |
|
|
19
|
+
| `$responsive` | Boolean | `false` | Generate responsive variants (`md:`, `lg:`, etc.) |
|
|
20
|
+
| `$with-state` | Boolean | `false` | Generate state variants (`:hover`, `:focus`, `:active`) |
|
|
21
|
+
| `$debug` | Boolean | `false` | Output debug info during compilation |
|
|
22
|
+
|
|
23
|
+
### `$properties-map` Configuration
|
|
24
|
+
|
|
25
|
+
```scss +code
|
|
26
|
+
$border-properties-map: (
|
|
27
|
+
border-width: (
|
|
28
|
+
prefix: 'bdr-', // Class prefix (optional)
|
|
29
|
+
values: $border-width-map, // Values to generate (required)
|
|
30
|
+
positions: $logical-position-map, // For directional properties (t, b, l, r)
|
|
31
|
+
omit-axis-keys: (xy), // Exclude x/y combinations
|
|
32
|
+
unit: 'px' // CSS unit
|
|
33
|
+
),
|
|
34
|
+
border-color: (
|
|
35
|
+
prefix: 'bdr-',
|
|
36
|
+
values: $colors-map
|
|
37
|
+
)
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
@include build-classes($border-properties-map);
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Examples
|
|
44
|
+
|
|
45
|
+
### Basic Usage
|
|
46
|
+
|
|
47
|
+
```scss +code
|
|
48
|
+
@include build-classes((
|
|
49
|
+
margin: (
|
|
50
|
+
prefix: 'm-',
|
|
51
|
+
values: (1, 2, 3, 4),
|
|
52
|
+
unit: 'rem'
|
|
53
|
+
)
|
|
54
|
+
));
|
|
55
|
+
// Output: .m-1, .m-2, .m-3, .m-4
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### With Positions
|
|
59
|
+
|
|
60
|
+
```scss +code
|
|
61
|
+
@include build-classes((
|
|
62
|
+
margin: (
|
|
63
|
+
prefix: 'm-',
|
|
64
|
+
values: (1, 2, 3),
|
|
65
|
+
positions: (t: margin-top, b: margin-bottom, l: margin-left, r: margin-right),
|
|
66
|
+
unit: 'rem'
|
|
67
|
+
)
|
|
68
|
+
));
|
|
69
|
+
// Output: .m-1, .mt-1, .mb-1, .ml-1, .mr-1
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### With Responsive Variants
|
|
73
|
+
|
|
74
|
+
```scss +code
|
|
75
|
+
@include build-classes((
|
|
76
|
+
display: (prefix: 'd-', values: (flex, grid, block, hidden))
|
|
77
|
+
), $responsive: true);
|
|
78
|
+
// Output: .d-flex, .md:d-flex, .lg:d-flex, etc.
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### With State Variants
|
|
82
|
+
|
|
83
|
+
```scss +code
|
|
84
|
+
@include build-classes((
|
|
85
|
+
opacity: (prefix: 'op-', values: (0.5, 0.75, 1))
|
|
86
|
+
), $with-state: true);
|
|
87
|
+
// Output: .op-0.5, .op-0.5:hover, .op-0.5:focus, etc.
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Omitting Axis Combinations
|
|
91
|
+
|
|
92
|
+
```scss +code
|
|
93
|
+
@include build-classes((
|
|
94
|
+
border-width: (
|
|
95
|
+
prefix: 'bdr-',
|
|
96
|
+
values: (1, 2, 3),
|
|
97
|
+
positions: $logical-position-map,
|
|
98
|
+
omit-axis-keys: (xy), // Exclude x/y combinations
|
|
99
|
+
unit: 'px'
|
|
100
|
+
)
|
|
101
|
+
));
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Output Structure
|
|
105
|
+
|
|
106
|
+
Pattern: `{breakpoint}:{property}-{value}{state}`
|
|
107
|
+
|
|
108
|
+
Examples: `m-1`, `md:m-1`, `m-1:hover`, `md:m-1:hover`
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# make-from-breakpoint()
|
|
2
|
+
|
|
3
|
+
Generate classes that apply from a specific breakpoint upward.
|
|
4
|
+
|
|
5
|
+
## Signature
|
|
6
|
+
|
|
7
|
+
```scss +code
|
|
8
|
+
@mixin make-from-breakpoint(
|
|
9
|
+
$properties,
|
|
10
|
+
$class,
|
|
11
|
+
$breakpoints
|
|
12
|
+
)
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Default | Description |
|
|
18
|
+
| ------------------- | ------- | ------- | -------------------------------------------------------------- |
|
|
19
|
+
| `$props` | Map | — | CSS properties and values (e.g., `(display: flex, gap: 1rem)`) |
|
|
20
|
+
| `$identifier` | String | — | Class name identifier (e.g., `flex-row`, `grid-2col`) |
|
|
21
|
+
| `$breakpoints` | List | — | Breakpoints (e.g., `(md, lg, xl)`) |
|
|
22
|
+
| `$child-selector` | Boolean | `false` | Generate child selector variant |
|
|
23
|
+
|
|
24
|
+
## Examples
|
|
25
|
+
|
|
26
|
+
### Basic Usage
|
|
27
|
+
|
|
28
|
+
```scss +code
|
|
29
|
+
@include make-from-breakpoint(
|
|
30
|
+
(display: flex, flex-direction: row),
|
|
31
|
+
'flex-row',
|
|
32
|
+
(md, lg)
|
|
33
|
+
);
|
|
34
|
+
// Output: .md:flex-row, .lg:flex-row
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Single Breakpoint
|
|
38
|
+
|
|
39
|
+
```scss +code
|
|
40
|
+
@include make-from-breakpoint(
|
|
41
|
+
(display: grid, grid-template-columns: repeat(3, 1fr)),
|
|
42
|
+
'grid-3',
|
|
43
|
+
(lg)
|
|
44
|
+
);
|
|
45
|
+
// Output: .lg:grid-3
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Output Structure
|
|
49
|
+
|
|
50
|
+
- `.{breakpoint}:{class-name}` — Applies from that breakpoint upward
|
|
51
|
+
|
|
52
|
+
Use case: Responsive layouts that change at specific screen sizes.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# make-on-breakpoint()
|
|
2
|
+
|
|
3
|
+
Generate classes that apply only on a specific breakpoint.
|
|
4
|
+
|
|
5
|
+
## Signature
|
|
6
|
+
|
|
7
|
+
```scss +code
|
|
8
|
+
@mixin make-on-breakpoint(
|
|
9
|
+
$properties,
|
|
10
|
+
$class,
|
|
11
|
+
$breakpoints
|
|
12
|
+
)
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Default | Description |
|
|
18
|
+
|-----------|------|---------|-------------|
|
|
19
|
+
| `$props` | Map | — | CSS properties and values (e.g., `(display: grid)`) |
|
|
20
|
+
| `$identifier` | String | — | Class name identifier (e.g., `tablet-grid`, `desktop-only`) |
|
|
21
|
+
| `$breakpoints` | List | — | Breakpoints (e.g., `(md, lg, xl)`) |
|
|
22
|
+
|
|
23
|
+
## Examples
|
|
24
|
+
|
|
25
|
+
### Basic Usage
|
|
26
|
+
|
|
27
|
+
```scss +code
|
|
28
|
+
@include make-on-breakpoint(
|
|
29
|
+
(display: grid, grid-template-columns: repeat(2, 1fr)),
|
|
30
|
+
'grid-2',
|
|
31
|
+
(md)
|
|
32
|
+
);
|
|
33
|
+
// Output: .on-md:grid-2
|
|
34
|
+
// Applies only on medium screens
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Multiple Breakpoints
|
|
38
|
+
|
|
39
|
+
```scss +code
|
|
40
|
+
@include make-on-breakpoint(
|
|
41
|
+
(font-size: 0.875rem),
|
|
42
|
+
'text-sm',
|
|
43
|
+
(sm, md)
|
|
44
|
+
);
|
|
45
|
+
// Output: .on-sm:text-sm, .on-md:text-sm
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Output Structure
|
|
49
|
+
|
|
50
|
+
- `.on-{breakpoint}:{class-name}` — Applies only on that breakpoint
|
|
51
|
+
|
|
52
|
+
Use case: Breakpoint-specific styling that doesn't cascade.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# make-position-based-class()
|
|
2
|
+
|
|
3
|
+
Generate classes for directional properties (margin, padding, border, etc.) with position variants.
|
|
4
|
+
|
|
5
|
+
## Signature
|
|
6
|
+
|
|
7
|
+
```scss +code
|
|
8
|
+
@mixin make-position-based-class(
|
|
9
|
+
$property,
|
|
10
|
+
$value,
|
|
11
|
+
$positions-map,
|
|
12
|
+
$identifier,
|
|
13
|
+
$variant,
|
|
14
|
+
$breakpoints,
|
|
15
|
+
$states: (),
|
|
16
|
+
$omit-axis-keys: (),
|
|
17
|
+
$child-selector: false
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Parameters
|
|
22
|
+
|
|
23
|
+
| Parameter | Type | Default | Description |
|
|
24
|
+
|-----------|------|---------|-------------|
|
|
25
|
+
| `$property` | String | — | CSS property name (e.g., `margin`, `padding`, `border-width`) |
|
|
26
|
+
| `$value` | String | — | CSS value (e.g., `1rem`, `2px`) |
|
|
27
|
+
| `$positions-map` | Map | — | Position keys to CSS properties (e.g., `(t: margin-top, b: margin-bottom)`) |
|
|
28
|
+
| `$identifier` | String | — | Class name identifier (e.g., `m`, `p`, `bdr`) |
|
|
29
|
+
| `$variant` | String | — | Variant suffix (e.g., `lg`, `sm`, `base`) |
|
|
30
|
+
| `$breakpoints` | List | — | Breakpoints for responsive variants (e.g., `(md, lg)`) |
|
|
31
|
+
| `$states` | List | `()` | Pseudo-classes for state variants (e.g., `(hover, focus)`) |
|
|
32
|
+
| `$omit-axis-keys` | List | `()` | Exclude axis combinations (e.g., `(xy)`) |
|
|
33
|
+
| `$child-selector` | Boolean | `false` | Generate child selector variant |
|
|
34
|
+
|
|
35
|
+
## Examples
|
|
36
|
+
|
|
37
|
+
### Basic Positional Classes
|
|
38
|
+
|
|
39
|
+
```scss +code
|
|
40
|
+
@include make-position-based-class(
|
|
41
|
+
'margin',
|
|
42
|
+
'1rem',
|
|
43
|
+
(t: margin-top, b: margin-bottom, l: margin-left, r: margin-right),
|
|
44
|
+
'm',
|
|
45
|
+
'base',
|
|
46
|
+
()
|
|
47
|
+
);
|
|
48
|
+
// Output: .m-base, .m-t-base, .m-b-base, .m-l-base, .m-r-base
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### With Variant Name
|
|
52
|
+
|
|
53
|
+
```scss +code
|
|
54
|
+
@include make-position-based-class(
|
|
55
|
+
'padding',
|
|
56
|
+
'1.5rem',
|
|
57
|
+
(t: padding-top, b: padding-bottom, x: (padding-left, padding-right)),
|
|
58
|
+
'p',
|
|
59
|
+
'lg',
|
|
60
|
+
()
|
|
61
|
+
);
|
|
62
|
+
// Output: .p-lg, .p-t-lg, .p-b-lg, .p-x-lg
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### With Responsive Variants
|
|
66
|
+
|
|
67
|
+
```scss +code
|
|
68
|
+
@include make-position-based-class(
|
|
69
|
+
'margin',
|
|
70
|
+
'2rem',
|
|
71
|
+
$logical-position-map,
|
|
72
|
+
'm',
|
|
73
|
+
'base',
|
|
74
|
+
(md, lg)
|
|
75
|
+
);
|
|
76
|
+
// Output: .m-base, .md:m-base, .lg:m-base, .m-t-base, .md:m-t-base, etc.
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Output Structure
|
|
80
|
+
|
|
81
|
+
- All positions: `.{id}`, `.{id}-t`, `.{id}-b`, `.{id}-l`, `.{id}-r`, `.{id}-x`, `.{id}-y`
|
|
82
|
+
- With variant: `.{id}-{variant}`, `.{id}-t-{variant}`, etc.
|
|
83
|
+
- With breakpoints: `.{bp}:{id}`, `.{bp}:{id}-t`, etc.
|