xylem-css 0.2.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/LICENSE +21 -0
- package/README.md +165 -0
- package/dist/xylem.css +1888 -0
- package/dist/xylem.min.css +2 -0
- package/dist/xylem.min.css.map +1 -0
- package/package.json +33 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Xylem CSS Contributors
|
|
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
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# Xylem CSS
|
|
2
|
+
|
|
3
|
+
A very lightweight CSS framework with simple utilities, layout helpers, and minimal components. No JavaScript. No complex tooling. Just CSS.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install xylem-css
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
Link directly:
|
|
14
|
+
|
|
15
|
+
```html
|
|
16
|
+
<link rel="stylesheet" href="node_modules/xylem-css/dist/xylem.css">
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Or use the minified version:
|
|
20
|
+
|
|
21
|
+
```html
|
|
22
|
+
<link rel="stylesheet" href="node_modules/xylem-css/dist/xylem.min.css">
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Import in a bundler:
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
import 'xylem-css'
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Via CDN (after publishing):
|
|
32
|
+
|
|
33
|
+
```html
|
|
34
|
+
<link rel="stylesheet" href="https://unpkg.com/xylem-css/dist/xylem.min.css">
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## What's included
|
|
38
|
+
|
|
39
|
+
### Layout
|
|
40
|
+
|
|
41
|
+
- `.container` — centered, max-width 960px wrapper
|
|
42
|
+
- `.row` — flex row with gap (`.row-nowrap`, `.row-center`, `.row-between`)
|
|
43
|
+
- `.stack` — vertical flex column (`.stack-sm`, `.stack-lg`)
|
|
44
|
+
- `.grid` — responsive auto-fill grid (customize minimum column width with `--xy-grid-min`)
|
|
45
|
+
|
|
46
|
+
### Components
|
|
47
|
+
|
|
48
|
+
- `.navbar` — flex navbar with brand, nav links, mobile toggle, and modifiers (`.navbar-bordered`, `.navbar-sticky`, `.navbar-collapse`, `.navbar-toggler`)
|
|
49
|
+
- `.dropdown` — CSS-only dropdown menu (`.dropdown-toggle`, `.dropdown-menu`, `.dropdown-end`, `.dropdown-divider`)
|
|
50
|
+
- `.card` — bordered card with image, body, footer, and shadow variant (`.card-shadow`)
|
|
51
|
+
- `.hero` — centered hero section (add `.hero-lg` for larger variant)
|
|
52
|
+
- `.avatar` — circular avatar image (`.avatar-sm`, `.avatar-lg`, `.avatar-toggle`)
|
|
53
|
+
- `.switch` — CSS-only toggle switch
|
|
54
|
+
- `.divider` — horizontal line with optional centered text label
|
|
55
|
+
- `.pagination` — page navigation links with active state
|
|
56
|
+
- `.badge` — inline pill badge (`.badge-primary`, `.badge-success`, `.badge-danger`, `.badge-warning`, `.badge-info`)
|
|
57
|
+
- `.progress` — progress bar with color variants (`.progress-success`, `.progress-danger`, `.progress-warning`, `.progress-info`)
|
|
58
|
+
- `.sidebar` — sticky sidebar navigation with sections (`.sidebar-brand`, `.sidebar-nav`, `.sidebar-section`)
|
|
59
|
+
- `.footer` — page footer with dark variant (`.footer-dark`, `.footer-brand`, `.footer-divider`, `.footer-bottom`)
|
|
60
|
+
|
|
61
|
+
### Forms
|
|
62
|
+
|
|
63
|
+
- Styled inputs, textareas, selects, checkboxes, radios
|
|
64
|
+
- Focus rings using the primary color
|
|
65
|
+
- Disabled states for all form elements
|
|
66
|
+
- Labels auto-detect inline context with checkboxes and radios
|
|
67
|
+
|
|
68
|
+
### Utilities
|
|
69
|
+
|
|
70
|
+
- Spacing — `.m-{0-5}`, `.p-{0-5}`, `.mt-{0-5}`, `.mb-{0-5}`, `.ml-{0-5}`, `.mr-{0-5}`, `.pt-{0-5}`, `.pb-{0-5}`, `.pl-{0-5}`, `.pr-{0-5}`, `.mx-auto`
|
|
71
|
+
- Flex — `.flex-1`, `.flex-auto`, `.flex-none`, `.items-{start,center,end,stretch}`, `.justify-{start,center,end,between}`, `.gap-{0-5}`
|
|
72
|
+
- Width — `.w-full`, `.max-w-full`
|
|
73
|
+
- Text — `.text-left`, `.text-center`, `.text-right`, `.text-xs`, `.text-sm`, `.text-md`, `.text-base`, `.text-lg`, `.text-muted`, `.text-primary`, `.text-success`, `.text-danger`, `.text-warning`, `.text-info`
|
|
74
|
+
- Font weight — `.font-light`, `.font-semibold`
|
|
75
|
+
- Typography — `.section-label` / `.overline` (uppercase muted label), `.display-number` (large light stat number), `.list-unstyled`, `.list-divided` (separator borders between items)
|
|
76
|
+
- Background — `.bg-subtle` (subtle background with border-radius)
|
|
77
|
+
- Meta — `.meta` (inline flex row for dates, authors, badges)
|
|
78
|
+
- Display — `.d-none`, `.d-block`, `.d-flex`, `.d-inline`, `.d-inline-block`
|
|
79
|
+
- Accessibility — `.sr-only` (screen reader only)
|
|
80
|
+
- Responsive — all display and spacing utilities support `-sm`, `-md`, `-lg` breakpoint variants (e.g., `.d-md-none`, `.p-lg-3`)
|
|
81
|
+
|
|
82
|
+
### Base styles
|
|
83
|
+
|
|
84
|
+
- CSS reset and box-sizing normalization
|
|
85
|
+
- Typography with responsive heading scale
|
|
86
|
+
- Styled links, buttons (`.button-primary`, `.button-success`, `.button-danger`, `.button-warning`, `.button-info`), lists, code, tables (`.table-striped`, `.table-hover`), `hr`
|
|
87
|
+
- Button outline variants (`.button-outline-primary`, `.button-outline-success`, `.button-outline-danger`, `.button-outline-warning`, `.button-outline-info`)
|
|
88
|
+
- Button modifiers: `.button-icon` (icon alignment), `.button-sq` (square icon-only), `.button-sm` (compact size)
|
|
89
|
+
- `::selection` and `accent-color` themed to primary
|
|
90
|
+
- `prefers-reduced-motion` respected — all animations and transitions are disabled
|
|
91
|
+
|
|
92
|
+
### CSS Layers
|
|
93
|
+
|
|
94
|
+
Xylem uses `@layer` to organize styles into `base`, `components`, and `utilities`. This means any custom CSS you write will automatically override framework styles without specificity battles. Utilities always beat components within the framework.
|
|
95
|
+
|
|
96
|
+
> **Note:** Bare `<button>` elements get a minimal reset (font, cursor). To apply the full styled look (uppercase, letter-spacing, border), add the `.button` class. Since the framework uses CSS layers, your own unlayered CSS will naturally override these defaults.
|
|
97
|
+
|
|
98
|
+
## Theming
|
|
99
|
+
|
|
100
|
+
Override CSS custom properties to theme the framework:
|
|
101
|
+
|
|
102
|
+
```css
|
|
103
|
+
:root {
|
|
104
|
+
--xy-color-primary: #008080;
|
|
105
|
+
--xy-color-primary-hover: #006666;
|
|
106
|
+
--xy-color-text: #222;
|
|
107
|
+
--xy-color-muted: #555;
|
|
108
|
+
--xy-color-bg: #fff;
|
|
109
|
+
--xy-color-bg-subtle: #f2f8f8;
|
|
110
|
+
--xy-color-border: #cfd8d8;
|
|
111
|
+
--xy-color-border-light: #e6eeee;
|
|
112
|
+
--xy-radius: 4px;
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Dark mode follows `prefers-color-scheme` automatically. To override manually:
|
|
117
|
+
|
|
118
|
+
```html
|
|
119
|
+
<!-- Force dark mode regardless of OS preference -->
|
|
120
|
+
<html data-theme="dark">
|
|
121
|
+
|
|
122
|
+
<!-- Force light mode regardless of OS preference -->
|
|
123
|
+
<html data-theme="light">
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Example
|
|
127
|
+
|
|
128
|
+
```html
|
|
129
|
+
<nav class="navbar navbar-bordered">
|
|
130
|
+
<a class="navbar-brand" href="#">My Site</a>
|
|
131
|
+
<ul class="navbar-nav">
|
|
132
|
+
<li><a href="/" class="active">Home</a></li>
|
|
133
|
+
<li><a href="/about">About</a></li>
|
|
134
|
+
</ul>
|
|
135
|
+
</nav>
|
|
136
|
+
|
|
137
|
+
<div class="container stack">
|
|
138
|
+
<section class="hero">
|
|
139
|
+
<h1>Welcome</h1>
|
|
140
|
+
<p>A lightweight starting point.</p>
|
|
141
|
+
<a class="button button-primary" href="#">Get Started</a>
|
|
142
|
+
</section>
|
|
143
|
+
|
|
144
|
+
<div class="row">
|
|
145
|
+
<div class="card">
|
|
146
|
+
<div class="card-body">
|
|
147
|
+
<h3 class="card-title">Card</h3>
|
|
148
|
+
<p class="card-text">Simple and clean.</p>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Size
|
|
156
|
+
|
|
157
|
+
~25 KB minified, ~5 KB gzipped.
|
|
158
|
+
|
|
159
|
+
## Browser Support
|
|
160
|
+
|
|
161
|
+
Chrome 105+, Firefox 121+, Safari 15.4+.
|
|
162
|
+
|
|
163
|
+
## License
|
|
164
|
+
|
|
165
|
+
MIT
|