@hygular/core 0.0.0-stage → 1.0.0-beta.2
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/CHANGELOG.md +35 -0
- package/CONTRIBUTING.md +117 -0
- package/LICENSE +21 -0
- package/README.md +253 -3
- package/build/breakpoints.js +26 -0
- package/build/clean.js +3 -0
- package/dist/css/hygular.css +14584 -0
- package/dist/css/hygular.min.css +10 -0
- package/dist/js/hygular.esm.js +459 -0
- package/dist/js/hygular.esm.js.map +1 -0
- package/dist/js/hygular.min.js +8 -0
- package/dist/js/hygular.min.js.map +1 -0
- package/dist/js/shared/Range-CAPV0fgM.js +4738 -0
- package/dist/js/shared/Range-CAPV0fgM.js.map +1 -0
- package/dist/react/hygular-react.esm.js +362 -0
- package/dist/react/hygular-react.esm.js.map +1 -0
- package/dist/react/index.d.ts +575 -0
- package/index.d.ts +990 -0
- package/package.json +102 -6
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Notable changes to Hygular are recorded here.
|
|
4
|
+
|
|
5
|
+
## [1.0.0-beta.2] - 2026-11-02
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Share delegated handlers across runtime instances and React hooks to prevent duplicate interactions, requests, and events.
|
|
10
|
+
- Release drawer scroll locks on removal and wait for panel transitions before opening another drawer.
|
|
11
|
+
- Cancel pending animations, timers, and listeners when the last subscriber disconnects.
|
|
12
|
+
- Prevent stale form requests from updating a new submission; abort requests when their forms are removed.
|
|
13
|
+
- Respect canceled form submissions and make `hygular.form.start` cancelable.
|
|
14
|
+
- Initialize newly inserted markup without resetting existing component state.
|
|
15
|
+
- Preserve active drawers and pending requests during runtime reinitialization.
|
|
16
|
+
|
|
17
|
+
### Tests
|
|
18
|
+
|
|
19
|
+
- Add coverage for shared subscriptions, React StrictMode, cleanup, request cancellation, and drawer transitions.
|
|
20
|
+
|
|
21
|
+
## [1.0.0-beta.1] - 2026-10-29
|
|
22
|
+
|
|
23
|
+
Initial public beta, published as `@hygular/core`.
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- Semantic utility CSS and component styles organized into `theme`, `base`, `components`, and `utilities` cascade layers.
|
|
28
|
+
- Design tokens, light and dark themes, and responsive utilities.
|
|
29
|
+
- A dependency-free JavaScript runtime with declarative data attributes and programmatic component APIs.
|
|
30
|
+
- Optional React hooks through `@hygular/core/react`.
|
|
31
|
+
- TypeScript declarations for the core API and React hooks.
|
|
32
|
+
- ES module and UMD JavaScript bundles with source maps.
|
|
33
|
+
- Minified CSS for direct use and an unminified stylesheet for the separate CSS compiler.
|
|
34
|
+
|
|
35
|
+
This is a prerelease. APIs may change before the first stable release.
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Contributing to Hygular
|
|
2
|
+
|
|
3
|
+
Contributions to Hygular are welcome, including bug reports, documentation corrections, accessibility improvements, and focused code changes.
|
|
4
|
+
|
|
5
|
+
For a new component, a public API change, or a substantial architectural change, open an issue first so the scope can be agreed before implementation.
|
|
6
|
+
|
|
7
|
+
## Design principles
|
|
8
|
+
|
|
9
|
+
Hygular brings semantic utility CSS, reusable components, and a lightweight JavaScript runtime together. Changes should keep those parts consistent.
|
|
10
|
+
|
|
11
|
+
- Use CSS for styling, layout, and states it can express reliably. Use JavaScript for behavior that needs it.
|
|
12
|
+
- Keep the core browser runtime free of third-party runtime dependencies. Build tools belong in development dependencies; compiler dependencies belong in the CLI package.
|
|
13
|
+
- Follow the existing component lifecycle and event handling. Both declarative initialization and programmatic APIs are supported; preserve the behavior of each where implemented.
|
|
14
|
+
- Keep React optional. React-specific code belongs in the adapter, not in the vanilla runtime.
|
|
15
|
+
- Reuse existing theme tokens and CSS layers. Prefer logical properties where appropriate, and check RTL behavior rather than assuming it follows automatically.
|
|
16
|
+
- Treat keyboard access, focus management, accessible names, and reduced-motion behavior as part of component behavior.
|
|
17
|
+
- Keep public names consistent across JavaScript, data attributes, CSS, TypeScript declarations, and examples.
|
|
18
|
+
|
|
19
|
+
## Local setup
|
|
20
|
+
|
|
21
|
+
Fork the repository, clone your fork, and open its root directory. Install dependencies and build the framework:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
npm install
|
|
25
|
+
npm run build
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
To rebuild the distributable files as source files change:
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
npm run build:watch
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The build commands use Rollup. Watch mode rebuilds files; it does not start a web server. Use a local page or the relevant example to exercise changes in a browser.
|
|
35
|
+
|
|
36
|
+
## Source layout
|
|
37
|
+
|
|
38
|
+
| Path | Purpose |
|
|
39
|
+
| --- | --- |
|
|
40
|
+
| `src/css/` | Theme tokens, base styles, components, and utilities |
|
|
41
|
+
| `src/js/` | Vanilla JavaScript runtime, components, and helpers |
|
|
42
|
+
| `src/react/` | React integration and its TypeScript declarations |
|
|
43
|
+
| `index.d.ts` | Core TypeScript declarations |
|
|
44
|
+
| `build/` | Framework build helpers, including breakpoint handling |
|
|
45
|
+
| `rollup.config.js` | JavaScript and CSS bundle configuration |
|
|
46
|
+
| `dist/` | Generated distribution files |
|
|
47
|
+
|
|
48
|
+
Make changes in the source files, then rebuild. Do not fix generated files in `dist/` directly.
|
|
49
|
+
|
|
50
|
+
The optional `@hygular/cli` package is developed and versioned separately. Compiler, scanning, cache, and watch changes belong there. The framework build must not import CLI internals. Changes to `hygular/css/source` or default breakpoint values need a compatibility check with the CLI.
|
|
51
|
+
|
|
52
|
+
## Making changes
|
|
53
|
+
|
|
54
|
+
Keep each pull request focused on one problem. Follow the surrounding code style and keep comments brief: explain constraints or non-obvious decisions rather than restating the code.
|
|
55
|
+
|
|
56
|
+
For JavaScript changes:
|
|
57
|
+
|
|
58
|
+
- Reuse the existing lifecycle, registration, and event utilities where appropriate.
|
|
59
|
+
- Clean up listeners, observers, timers, and temporary DOM changes when a component is destroyed.
|
|
60
|
+
- Check repeated initialization and interactions between multiple instances.
|
|
61
|
+
- Keep imports safe in environments without a DOM where the API supports that use.
|
|
62
|
+
- Update TypeScript declarations and React bindings when the affected public API changes.
|
|
63
|
+
|
|
64
|
+
For CSS changes:
|
|
65
|
+
|
|
66
|
+
- Place rules in the appropriate layer and reuse existing tokens.
|
|
67
|
+
- Check responsive behavior, relevant themes, and RTL layouts.
|
|
68
|
+
- Check component states together with the JavaScript that controls them.
|
|
69
|
+
- When changing selectors, tokens, or media-query structure, check that the separate CLI still retains the required CSS.
|
|
70
|
+
|
|
71
|
+
## Checking your work
|
|
72
|
+
|
|
73
|
+
Run `npm run build` before submitting a pull request. A successful build is a baseline; it does not replace behavior checks.
|
|
74
|
+
|
|
75
|
+
Use checks appropriate to the change:
|
|
76
|
+
|
|
77
|
+
- Reproduce the original bug and verify the fix with a small example.
|
|
78
|
+
- Exercise affected interactions in Chrome or Edge and Firefox. Include Safari when the change involves browser-specific behavior or you have access to it.
|
|
79
|
+
- For interactive components, check keyboard navigation, focus restoration, and open/close or show/dismiss behavior as applicable.
|
|
80
|
+
- For responsive styles, check both sides of each affected breakpoint.
|
|
81
|
+
- For React changes, check mounting, updates, unmounting, and repeated effects in Strict Mode.
|
|
82
|
+
- For type changes, compile a small usage example against the declarations.
|
|
83
|
+
- Add or update a focused regression test where a suitable test suite exists.
|
|
84
|
+
|
|
85
|
+
In the pull request, state what you tested and any environment you could not check. Do not describe untested behavior as verified.
|
|
86
|
+
|
|
87
|
+
## Pull requests
|
|
88
|
+
|
|
89
|
+
Create a branch from the repository's default branch and use a descriptive name, such as `fix/modal-focus` or `docs/react-usage`.
|
|
90
|
+
|
|
91
|
+
Use clear commit messages. Conventional Commits are preferred:
|
|
92
|
+
|
|
93
|
+
```text
|
|
94
|
+
fix: restore focus after closing a modal
|
|
95
|
+
feat: add a component option
|
|
96
|
+
docs: clarify React setup
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Explain the problem, the change, and its effect on users. Include reproduction steps for a bug fix and screenshots or a small demo when they help explain a visual change. Call out public API changes and any migration needed.
|
|
100
|
+
|
|
101
|
+
Add a concise entry under `[Unreleased]` in `CHANGELOG.md` for user-facing changes. Internal cleanup usually does not need an entry. Leave release dates and version headings to the release process.
|
|
102
|
+
|
|
103
|
+
## Bug reports
|
|
104
|
+
|
|
105
|
+
Include:
|
|
106
|
+
|
|
107
|
+
- The Hygular version and how you load it: a package import, a browser bundle, or the React integration.
|
|
108
|
+
- Expected and actual behavior.
|
|
109
|
+
- The smallest code example that reproduces the issue.
|
|
110
|
+
- Browser, operating system, and relevant build-tool versions.
|
|
111
|
+
- Console errors or build output, if present.
|
|
112
|
+
|
|
113
|
+
For CLI issues, also include the CLI version, relevant configuration, and source classes that produce the unexpected CSS. Remove secrets and private data before sharing a reproduction.
|
|
114
|
+
|
|
115
|
+
## License
|
|
116
|
+
|
|
117
|
+
Contributions to Hygular are provided under the project's MIT License. Only submit code and assets you have the right to contribute.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Eyruz Badalzada
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,253 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# Hygular
|
|
2
|
+
|
|
3
|
+
**Independent Frontend UI Engine**
|
|
4
|
+
|
|
5
|
+
Hygular combines semantic utility CSS, reusable component styles, and a lightweight JavaScript runtime. Use utilities for layout, component styles for common interface patterns, and data attributes or JavaScript APIs for interactive behavior.
|
|
6
|
+
|
|
7
|
+
Use the CSS on its own, initialize the vanilla runtime, or manage individual components through React hooks. The core browser runtime has no third-party JavaScript dependencies. React integration is optional, and the CSS compiler is distributed separately.
|
|
8
|
+
|
|
9
|
+
[Documentation](https://hygular.com/docs) · [Contributing](CONTRIBUTING.md) · [Changelog](CHANGELOG.md) · [MIT License](LICENSE)
|
|
10
|
+
|
|
11
|
+
## What is included
|
|
12
|
+
|
|
13
|
+
- **CSS:** theme tokens, utilities, responsive styles, and component styles organized into `theme`, `base`, `components`, and `utilities` cascade layers.
|
|
14
|
+
- **JavaScript:** delegated interactions, initialization and observation of supported markup, and programmatic component APIs.
|
|
15
|
+
- **React:** hooks exported from `@hygular/core/react`, with TypeScript declarations. React is optional for the core package.
|
|
16
|
+
- **Distribution:** ES module and UMD JavaScript bundles, source maps, and minified CSS for direct use.
|
|
17
|
+
- **Optional compiler:** `@hygular/cli` scans source files and builds a stylesheet from the CSS your project uses, its required dependencies, and configured additions.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
Hygular is currently in beta. The examples below use `@hygular/core@1.0.0-beta.2`. APIs may change before the first stable release.
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
npm install @hygular/core@1.0.0-beta.2
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### With a bundler
|
|
28
|
+
|
|
29
|
+
Import the stylesheet in your application entry point:
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
import "@hygular/core/css";
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
For a vanilla application, initialize the runtime once in a browser entry point, after the page markup is available:
|
|
36
|
+
|
|
37
|
+
```js
|
|
38
|
+
import "@hygular/core/css";
|
|
39
|
+
import { Hygular } from "@hygular/core";
|
|
40
|
+
|
|
41
|
+
new Hygular();
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
CSS utilities and static component styles do not require runtime initialization:
|
|
45
|
+
|
|
46
|
+
```html
|
|
47
|
+
<div class="is-flex gap-3">
|
|
48
|
+
<button type="button" class="button is-primary">Save changes</button>
|
|
49
|
+
<button type="button" class="button">Cancel</button>
|
|
50
|
+
</div>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Component-specific markup and behavior are covered in the [documentation](https://hygular.com/docs).
|
|
54
|
+
|
|
55
|
+
### With a CDN
|
|
56
|
+
|
|
57
|
+
Add the stylesheet to the document head:
|
|
58
|
+
|
|
59
|
+
```html
|
|
60
|
+
<link
|
|
61
|
+
rel="stylesheet"
|
|
62
|
+
href="https://cdn.jsdelivr.net/npm/@hygular/core@1.0.0-beta.2/dist/css/hygular.min.css"
|
|
63
|
+
/>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Place the scripts after your page content, before `</body>`:
|
|
67
|
+
|
|
68
|
+
```html
|
|
69
|
+
<script src="https://cdn.jsdelivr.net/npm/@hygular/core@1.0.0-beta.2/dist/js/hygular.min.js"></script>
|
|
70
|
+
<script>
|
|
71
|
+
new Hygular();
|
|
72
|
+
</script>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The UMD bundle exposes `Hygular` on `window`. Omit both scripts when you only need CSS.
|
|
76
|
+
|
|
77
|
+
## Package entry points
|
|
78
|
+
|
|
79
|
+
| Entry point | Purpose |
|
|
80
|
+
| --- | --- |
|
|
81
|
+
| `@hygular/core` | JavaScript runtime and public component APIs |
|
|
82
|
+
| `@hygular/core/react` | React hooks and their TypeScript declarations |
|
|
83
|
+
| `@hygular/core/css` | Minified stylesheet for direct use |
|
|
84
|
+
| `@hygular/core/css/source` | Unminified stylesheet for the CSS compiler |
|
|
85
|
+
|
|
86
|
+
The CSS paths are package exports. `@hygular/core/css/source` resolves to `dist/css/hygular.css`; it is not a separate source directory.
|
|
87
|
+
|
|
88
|
+
## Components
|
|
89
|
+
|
|
90
|
+
| Area | Components and behaviors |
|
|
91
|
+
| --- | --- |
|
|
92
|
+
| Navigation and disclosure | Navbar, Drawer, Dropdown, Collapse, Accordion, Tabview |
|
|
93
|
+
| Overlays and feedback | Modal, Toast, Tooltip, Popover, Alert |
|
|
94
|
+
| Forms and inputs | Form, Select, Range |
|
|
95
|
+
| Content and loading | Carousel, Swiper, Badge, Skeleton, LazyImage |
|
|
96
|
+
| Appearance | DarkMode |
|
|
97
|
+
|
|
98
|
+
The runtime initializes supported declarative components and binds delegated interactions. Components with public JavaScript exports can also be imported directly:
|
|
99
|
+
|
|
100
|
+
```js
|
|
101
|
+
import { Modal, Toast, Carousel, Range } from "@hygular/core";
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Importing a component does not create an instance. Use its documented constructor or helper methods, and dispose of instances when they are no longer needed.
|
|
105
|
+
|
|
106
|
+
## React and server rendering
|
|
107
|
+
|
|
108
|
+
React hooks are available through the `@hygular/core/react` entry point of the same package. They connect component behavior to effects and refs; no Hygular provider is required.
|
|
109
|
+
|
|
110
|
+
```tsx
|
|
111
|
+
"use client";
|
|
112
|
+
|
|
113
|
+
import { useRange } from "@hygular/core/react";
|
|
114
|
+
|
|
115
|
+
export default function VolumeControl() {
|
|
116
|
+
const { ref, value } = useRange();
|
|
117
|
+
|
|
118
|
+
return (
|
|
119
|
+
<div>
|
|
120
|
+
<label htmlFor="volume">Volume</label>
|
|
121
|
+
<div ref={ref} className="group-range">
|
|
122
|
+
<input
|
|
123
|
+
id="volume"
|
|
124
|
+
className="form-range"
|
|
125
|
+
type="range"
|
|
126
|
+
min="0"
|
|
127
|
+
max="100"
|
|
128
|
+
defaultValue="50"
|
|
129
|
+
/>
|
|
130
|
+
</div>
|
|
131
|
+
<output htmlFor="volume">{String(value ?? 50)}</output>
|
|
132
|
+
</div>
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Import `@hygular/core/css` once at the global stylesheet entry allowed by your application framework. In a Next.js App Router application, that can be the root layout.
|
|
138
|
+
|
|
139
|
+
Hygular's styles and markup can be used in server-rendered pages. Interactive behavior needs a browser DOM: initialize it after the markup is mounted, and keep hook-based components inside a client boundary where your framework requires one. The React hooks perform their DOM setup in effects, which do not run during server rendering.
|
|
140
|
+
|
|
141
|
+
Do not initialize the same element through both a React hook and a separate manual setup. Choose the integration that owns its lifecycle.
|
|
142
|
+
|
|
143
|
+
## Optional CSS compiler
|
|
144
|
+
|
|
145
|
+
Install the CLI only when you want source scanning and a project-specific stylesheet:
|
|
146
|
+
|
|
147
|
+
```sh
|
|
148
|
+
npm install -D @hygular/cli@beta
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
The CLI requires Node.js 20.19.0 or later. Its parser, compiler, and watcher dependencies stay in the CLI package; installing `@hygular/core` alone does not install them.
|
|
152
|
+
|
|
153
|
+
Create `hygular.config.js` at the project root. This example uses ES module syntax:
|
|
154
|
+
|
|
155
|
+
```js
|
|
156
|
+
export default {
|
|
157
|
+
theme: {
|
|
158
|
+
primary: "#2563eb",
|
|
159
|
+
},
|
|
160
|
+
jit: {
|
|
161
|
+
scan: ["./src", "./app", "./components", "./pages"],
|
|
162
|
+
safelist: ["button", "is-primary"],
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Keep the scan paths that match your project, then build:
|
|
168
|
+
|
|
169
|
+
```sh
|
|
170
|
+
npx hygular build
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
The default output is `public/hygular.build.css`. Load that generated stylesheet in place of the full `@hygular/core/css` stylesheet.
|
|
174
|
+
|
|
175
|
+
To rebuild when watched files change:
|
|
176
|
+
|
|
177
|
+
```sh
|
|
178
|
+
npx hygular dev
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Use a CLI release that supports `@hygular/core`. The compiler uses the unminified stylesheet exposed by `@hygular/core/css/source` as its input; this entry is intended for compilation rather than direct browser use.
|
|
182
|
+
|
|
183
|
+
Use complete class names in source expressions:
|
|
184
|
+
|
|
185
|
+
```jsx
|
|
186
|
+
<div className={active ? "bg-primary" : "bg-surface"} />
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
The scanner can collect both alternatives. It cannot infer arbitrary runtime values in expressions such as `` `bg-${color}` ``. List the complete alternatives in source or include them in `jit.safelist`.
|
|
190
|
+
|
|
191
|
+
## Themes and breakpoints
|
|
192
|
+
|
|
193
|
+
The CSS includes an OKLCH palette, shared design tokens, logical properties, and dark-theme variables. Reuse those tokens when extending components, and check contrast and layout in the themes you support.
|
|
194
|
+
|
|
195
|
+
For a vanilla runtime setup, theme options can be supplied during initialization:
|
|
196
|
+
|
|
197
|
+
```js
|
|
198
|
+
new Hygular({
|
|
199
|
+
theme: {
|
|
200
|
+
primary: "#6366f1",
|
|
201
|
+
},
|
|
202
|
+
});
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
This configures the browser runtime. When using the compiler, define theme options in `hygular.config.js` and rebuild the stylesheet. Runtime style injection is skipped when the page contains a stylesheet link whose URL includes `hygular.build.css`.
|
|
206
|
+
|
|
207
|
+
The default breakpoint values are:
|
|
208
|
+
|
|
209
|
+
| Prefix | Width |
|
|
210
|
+
| --- | --- |
|
|
211
|
+
| `sm` | `640px` |
|
|
212
|
+
| `md` | `864px` |
|
|
213
|
+
| `lg` | `1120px` |
|
|
214
|
+
| `xl` | `1408px` |
|
|
215
|
+
| `2xl` | `1792px` |
|
|
216
|
+
|
|
217
|
+
To override the existing breakpoint aliases in CLI output:
|
|
218
|
+
|
|
219
|
+
```js
|
|
220
|
+
export default {
|
|
221
|
+
theme: {
|
|
222
|
+
breakpoints: {
|
|
223
|
+
md: "900px",
|
|
224
|
+
lg: "1200px",
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
jit: {
|
|
228
|
+
scan: ["./src"],
|
|
229
|
+
},
|
|
230
|
+
};
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Rebuild the stylesheet after changing these values. The prebuilt CSS uses the defaults; runtime CSS variable changes do not rewrite its compiled media queries.
|
|
234
|
+
|
|
235
|
+
## Browser support
|
|
236
|
+
|
|
237
|
+
Hygular targets modern browsers. The CSS uses features such as cascade layers, custom properties, OKLCH colors, logical properties, and selectors including `:has()` and `:user-invalid`. Interactive components also use modern DOM APIs, including `IntersectionObserver` and `MutationObserver` where needed.
|
|
238
|
+
|
|
239
|
+
Check the components you use in your target browsers, including keyboard navigation, focus handling, and responsive layouts.
|
|
240
|
+
|
|
241
|
+
## Contributing
|
|
242
|
+
|
|
243
|
+
Bug reports, documentation corrections, accessibility improvements, and focused code changes are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for local setup and review guidance.
|
|
244
|
+
|
|
245
|
+
For a bug report, include the Hygular version, browser, expected behavior, and a small reproduction. Include the CLI version and configuration when reporting generated CSS issues.
|
|
246
|
+
|
|
247
|
+
## About the name
|
|
248
|
+
|
|
249
|
+
Hygular is an invented name inspired by the Danish word *hygge*. It reflects the project's aim: styling, components, and behavior that fit comfortably together.
|
|
250
|
+
|
|
251
|
+
## License
|
|
252
|
+
|
|
253
|
+
[MIT](LICENSE) © Eyruz Badalzada
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Hygular v1.0.0-beta.2
|
|
3
|
+
* (c) Eyruz Badalzada
|
|
4
|
+
* Released under the MIT License
|
|
5
|
+
* https://hygular.com
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export const DEFAULT_BREAKPOINTS = {
|
|
9
|
+
sm: "640px",
|
|
10
|
+
md: "864px",
|
|
11
|
+
lg: "1120px",
|
|
12
|
+
xl: "1408px",
|
|
13
|
+
"2xl": "1792px",
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/** Replace breakpoint placeholders in media queries. */
|
|
17
|
+
export function applyBreakpoints(root, breakpoints) {
|
|
18
|
+
const pattern = /var\(--breakpoint-(sm|md|lg|xl|2xl)\)/g;
|
|
19
|
+
|
|
20
|
+
root.walkAtRules("media", (rule) => {
|
|
21
|
+
rule.params = rule.params.replace(
|
|
22
|
+
pattern,
|
|
23
|
+
(match, alias) => breakpoints[alias] || match,
|
|
24
|
+
);
|
|
25
|
+
});
|
|
26
|
+
}
|
package/build/clean.js
ADDED