|
1 | | -<img src="https://i.ibb.co/BBw7NLd/M-2.png" alt="MinimaCSS Logo" style="height: 100px; width:100px;"/> |
| 1 | +# MinimaCSS |
2 | 2 |
|
3 | | -# MinimaCSS ✨ |
| 3 | +**A minimal CSS framework, fully modern. ~24 KB gzipped. Built for Baseline 2024+.** |
4 | 4 |
|
5 | | -MinimaCSS is an elegantly designed and versatile CSS framework, perfect for crafting beautiful websites. Launched in 2017 and refined in 2018 for a variety of web projects, MinimaCSS encapsulates the vision of providing an accessible yet sophisticated tool for web design. It's an ideal solution for newcomers seeking beauty in simplicity and professionals demanding aesthetic finesse in their projects. |
| 5 | +MinimaCSS isn't another Bootstrap-alike. It's a small CSS framework built on the features that finally let CSS solve problems that used to require JavaScript or huge utility-class bundles: `light-dark()`, `color-mix()`, `@starting-style`, `:user-invalid`, container queries, cascade layers, Popover + Anchor Positioning, and `:has()`. |
6 | 6 |
|
7 | | -This framework celebrates the beauty of design, offering a harmonious balance between ease of use and the ability to create stunning visual experiences. |
| 7 | +```html |
| 8 | +<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/hardikforall/MinimaCSS@v0.3.0/dist/minimacss.min.css"> |
| 9 | +``` |
| 10 | + |
| 11 | +[Live component showcase](https://hardikforall.github.io/MinimaCSS/examples/) · [Docs](https://hardikforall.github.io/MinimaCSS/docs/) · [Dashboard demo](https://hardikforall.github.io/MinimaCSS/examples/dashboard.html) |
| 12 | + |
| 13 | +--- |
8 | 14 |
|
9 | | -### Why MinimaCSS? |
| 15 | +## Pain points it solves (that other frameworks don't) |
10 | 16 |
|
11 | | -In an era where front-end frameworks can be cumbersome and complex, MinimaCSS emerges as a beacon of aesthetic clarity. It revives the essence of CSS design, blending simplicity with the capability to create visually appealing interfaces. |
| 17 | +### 1. One-token rebrand |
12 | 18 |
|
13 | | -### Features 🚀 |
| 19 | +Change a single CSS variable; every button, link, focus ring, and accent in the framework re-tints automatically via `color-mix(in oklch, …)`. |
14 | 20 |
|
15 | | -- Extensive Components: Extensive selection of pre-built components, ready for integration into diverse web projects. |
16 | | -- Design Flexibility: Each element is meticulously crafted for visual excellence, supporting a wide range of aesthetic preferences. |
17 | | -- Utility Classes: Comprehensive and intuitive utility classes for rapid, flexible design adjustments. |
18 | | -- Responsive Design: Built for seamless responsiveness, ensuring compatibility across all devices. |
19 | | -- Utilities: Handy utility classes for spacing, visibility, backgrounds, text colors, and more. |
20 | | -- Light and Dark Mode : Light and Dark mode Included by default. Default dark mode for modern aesthetics. |
21 | | -- Comprehensive Documentation : Detailed documentation and support for a smooth development experience. |
| 21 | +```css |
| 22 | +:root { --accent-color: #ff5a5f; } |
| 23 | +/* Hover, focus, ring, link, nav, progress bar, toast — all updated. */ |
| 24 | +``` |
| 25 | + |
| 26 | +No Tailwind config rebuild. No Bootstrap Sass recompile. No theme file with 80 redeclarations. |
22 | 27 |
|
23 | | -## Installation 💾 |
| 28 | +### 2. One declaration per token (light *and* dark) |
24 | 29 |
|
25 | | -To get started with MinimaCSS, you have two options: download the compiled CSS directly or download the project, customise it and build your own css. |
| 30 | +Themes are defined once using `light-dark()`: |
| 31 | + |
| 32 | +```css |
| 33 | +--surface-primary-color: light-dark(#ffffff, #111a33); |
| 34 | +--text-primary-color: light-dark(#182447, #c8d3f7); |
| 35 | +``` |
26 | 36 |
|
27 | | -### CDN Include |
| 37 | +`<html data-theme="dark">` flips `color-scheme`; the values resolve automatically. No `dark:` utility prefixes. No second `.dark { … }` block. |
28 | 38 |
|
29 | | -You can directly use latest minimacss from CDN use the below link in your html |
| 39 | +### 3. Forms that aren't angry by default |
| 40 | + |
| 41 | +`:user-invalid` styles only fire **after the user has interacted with the field** — no more red borders on every input the moment the page loads. |
30 | 42 |
|
31 | 43 | ```html |
32 | | -<link |
33 | | - rel="stylesheet" |
34 | | - href="https://cdn.jsdelivr.net/gh/hardikforall/MinimaCSS/dist/minimacss.css" |
35 | | -/> |
| 44 | +<div class="field"> |
| 45 | + <label for="email">Email</label> |
| 46 | + <input id="email" class="input" type="email" required> |
| 47 | + <small class="helper-text">We never share your email.</small> |
| 48 | +</div> |
| 49 | +``` |
| 50 | + |
| 51 | +The `.field` wrapper auto-appends a required asterisk (via `:has(:required)`) and flips the helper-text colour on `:user-invalid`. No JavaScript, no `.is-invalid` class to toggle. |
| 52 | + |
| 53 | +### 4. JS-free menus, dropdowns, modals, accordions |
| 54 | + |
| 55 | +| Component | How it works | |
| 56 | +|---|---| |
| 57 | +| **Modal** | Native `<dialog>` + `@starting-style` + `transition-behavior: allow-discrete` | |
| 58 | +| **Dropdown / Popover** | Native `popover` attribute + CSS Anchor Positioning | |
| 59 | +| **Accordion** | Native `<details>` / `<summary>` | |
| 60 | +| **Tooltip** | CSS-only via `:hover` / `:focus-within` | |
| 61 | +| **Theme switcher** | `<input type="radio">` + `:checked` + `color-scheme` | |
| 62 | + |
| 63 | +No focus-trap library. No `aria-*` attribute juggling. The browser handles open/close, escape-to-dismiss, light-dismiss, focus restoration, and stacking. |
| 64 | + |
| 65 | +### 5. Animate from `display: none` |
| 66 | + |
| 67 | +Modal, slideover, toast, and popover all use `@starting-style` + `allow-discrete` so they animate both open *and* close — even though the closed state is `display: none`. No `animation-fill-mode` games, no `setTimeout` workarounds. |
| 68 | + |
| 69 | +### 6. Container-query-aware components |
| 70 | + |
| 71 | +`.card` is itself a query container. The same card adapts its padding to its own width — narrower in a sidebar, more generous in a hero. No JS observer, no breakpoint guess-work. |
| 72 | + |
| 73 | +### 7. Cascade layers — no `!important` |
| 74 | + |
| 75 | +```css |
| 76 | +@layer reset, base, components, utilities; |
36 | 77 | ``` |
37 | 78 |
|
38 | | -or you can use Minified css |
| 79 | +Utility classes reliably override component styles because they live in a later layer. The framework ships ~13 `!important` declarations total — all in print or reduced-motion contexts. |
| 80 | + |
| 81 | +### 8. Layout primitives for the patterns you actually write |
39 | 82 |
|
40 | 83 | ```html |
41 | | -<link |
42 | | - rel="stylesheet" |
43 | | - href="https://cdn.jsdelivr.net/gh/hardikforall/MinimaCSS/dist/minimacss.min.css" |
44 | | -/> |
| 84 | +<div class="stack">…</div> <!-- vertical rhythm --> |
| 85 | +<div class="cluster">…</div> <!-- wrap with gap --> |
| 86 | +<article class="center">…</article> <!-- centered measure --> |
| 87 | +<div class="sidebar-layout">…</div> <!-- sidebar + main, wraps --> |
| 88 | +<div class="switcher">…</div> <!-- row → column at threshold --> |
45 | 89 | ``` |
46 | 90 |
|
47 | | -### Direct Download 📦 |
| 91 | +Inspired by [Every-Layout](https://every-layout.dev/). One-line solutions for 80% of the layouts you currently write by hand. |
48 | 92 |
|
49 | | -Download the `minimacss.css` file from the `/dist` folder and include it in your project: |
| 93 | +### 9. Modern input affixes (without "input-group" choreography) |
50 | 94 |
|
51 | 95 | ```html |
52 | | -<link rel="stylesheet" href="path-to-minimacss/minimacss.css" /> |
| 96 | +<div class="input-affix"> |
| 97 | + <span class="input-affix-prefix">$</span> |
| 98 | + <input class="input" type="number"> |
| 99 | + <span class="input-affix-suffix">USD</span> |
| 100 | +</div> |
53 | 101 | ``` |
54 | 102 |
|
55 | | -### Customization and Building 🛠️ |
| 103 | +`:has(:focus-visible)` on the wrapper lifts the focus ring onto the whole affix. No nested-control choreography. |
56 | 104 |
|
57 | | -MinimaCSS is designed to be easily customizable. To create a version tailored to your needs, follow these steps: |
| 105 | +### 10. Drop-in skeleton, empty state, scroll-snap |
58 | 106 |
|
59 | | -1. Clone the repository: |
| 107 | +```html |
| 108 | +<div class="skeleton skeleton-text"></div> |
60 | 109 |
|
61 | | -```bash |
62 | | -git clone https://github.com/hardikforall/MinimaCSS.git |
| 110 | +<div class="empty-state"> |
| 111 | + <h3 class="empty-state-title">No orders yet</h3> |
| 112 | + <p class="empty-state-description">When customers place an order it'll appear here.</p> |
| 113 | +</div> |
| 114 | + |
| 115 | +<div class="scroll-x snap-x"> |
| 116 | + <article class="card snap-start">…</article> |
| 117 | + <article class="card snap-start">…</article> |
| 118 | +</div> |
63 | 119 | ``` |
64 | 120 |
|
65 | | -2. Navigate to the project directory |
| 121 | +Skeleton shimmer respects `prefers-reduced-motion`. Empty state is a one-line component. Carousels are a no-JS CSS pattern. |
| 122 | + |
| 123 | +### 11. Named z-index scale (no more `9999`) |
| 124 | + |
| 125 | +```css |
| 126 | +--z-dropdown: 100; |
| 127 | +--z-sticky: 200; |
| 128 | +--z-overlay: 900; |
| 129 | +--z-modal: 1000; |
| 130 | +--z-popover: 1100; |
| 131 | +--z-toast: 1200; |
| 132 | +--z-tooltip: 1300; |
| 133 | +``` |
| 134 | + |
| 135 | +Layer overlays by name. Modals can never sit above toasts by accident. |
| 136 | + |
| 137 | +### 12. Self-contained |
66 | 138 |
|
67 | | -3. Install the required dependencies: |
| 139 | +- No external font import (system stack by default; opt in to Inter via one variable). |
| 140 | +- No icon font requirement (framework is icon-agnostic; examples use inline SVG). |
| 141 | +- No JavaScript bundle. Pages that don't use Tabs work with zero JS. |
| 142 | + |
| 143 | +--- |
| 144 | + |
| 145 | +## Quick feature list |
| 146 | + |
| 147 | +- **25+ components** — buttons, inputs, **`.field`**, **`.input-affix`**, **`.kbd`**, modals, accordion, navigation, cards, slideovers, steps, tabs, segments, loader, progress, tables, avatars, badges, dividers, tooltips, toasts, pagination, alerts, **popover**, **skeleton**, **empty-state** |
| 148 | +- **Layout primitives** — `.stack`, `.cluster`, `.center`, `.sidebar-layout`, `.switcher`, `.cover`, `.box` |
| 149 | +- **Container queries** — `.cq`, `.cq-named`, plus `.card` is itself a container |
| 150 | +- **Scroll-snap utilities** — `.scroll-x`, `.snap-x/-y`, `.snap-start/-center/-end`, plus `.scroll-x-hide-scrollbar` |
| 151 | +- **Theme-aware visibility** — `.only-light` / `.only-dark` |
| 152 | +- **Cascade layers** — utilities beat components without `!important` |
| 153 | +- **Light & Dark mode** built in via `light-dark()` + `color-scheme` |
| 154 | +- **Modern Sass** — `@use`/`@forward`, no `@import`, no `map-get`, no `green()`/`blue()` — zero deprecation warnings on Dart Sass 1.100+ |
| 155 | +- **Accessibility-first** — `:focus-visible`, WCAG-AA contrast tokens, `prefers-reduced-motion`, 40px+ touch targets, print stylesheet, `.sr-only` |
| 156 | +- **Tiny** — ~126 KB minified, ~24 KB gzipped, **0 npm vulnerabilities** |
| 157 | + |
| 158 | +## Installation |
| 159 | + |
| 160 | +### From CDN |
| 161 | + |
| 162 | +```html |
| 163 | +<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/hardikforall/MinimaCSS@v0.3.0/dist/minimacss.min.css"> |
| 164 | +``` |
| 165 | + |
| 166 | +### From npm |
68 | 167 |
|
69 | 168 | ```bash |
70 | | -npm install |
| 169 | +npm install minimacss |
71 | 170 | ``` |
72 | 171 |
|
73 | | -4. Make your customizations: Edit the SCSS files in the /src directory to suit your project's needs. You can modify variables, adjust styles, or even add new components. |
| 172 | +```html |
| 173 | +<link rel="stylesheet" href="/node_modules/minimacss/dist/minimacss.min.css"> |
| 174 | +``` |
74 | 175 |
|
75 | | -5. Build your custom CSS: Once you've made your changes, you can build your custom version of MinimaCSS by running: |
| 176 | +### From source |
76 | 177 |
|
77 | 178 | ```bash |
| 179 | +git clone https://github.com/hardikforall/MinimaCSS.git |
| 180 | +cd MinimaCSS |
| 181 | +npm install |
78 | 182 | npm run build |
79 | 183 | ``` |
80 | 184 |
|
81 | | -This command compiles your SCSS files and outputs a minified CSS file in the /dist directory. |
82 | | -And you're done! You now have a version of MinimaCSS that's tailored specifically to your project's requirements. |
| 185 | +`dist/minimacss.css` and `dist/minimacss.min.css` (with autoprefixer + source map) land in `dist/`. |
83 | 186 |
|
84 | | -## Documentation 📘 |
| 187 | +## Theming |
85 | 188 |
|
86 | | -**Get Started**: Quick and easy guides to get you up and running. |
87 | | -**Advanced Usage**: In-depth tutorials for advanced features and customization. |
88 | | -**Latest Updates**: Stay updated with new features and improvements. |
| 189 | +```css |
| 190 | +:root { |
| 191 | + --accent-color: #4f46e5; /* every interactive accent re-tints */ |
| 192 | +} |
| 193 | +``` |
89 | 194 |
|
90 | | -[Explore Documentation](https://hardikforall.github.io/MinimaCSS/docs/) |
| 195 | +Force a theme: |
91 | 196 |
|
92 | | -### Todo |
| 197 | +```html |
| 198 | +<html data-theme="dark"> <!-- or "light", or omit for OS-driven --> |
| 199 | +``` |
| 200 | + |
| 201 | +Customise any token — every CSS variable in [`src/themes/_theme.scss`](src/themes/_theme.scss) is fair game. |
| 202 | + |
| 203 | +## Documentation |
| 204 | + |
| 205 | +- [Getting Started](docs/GettingStarted.md) |
| 206 | +- [Theming & Dark Mode](docs/theme.md) |
| 207 | +- [Customisation](docs/customization.md) |
| 208 | +- [Accessibility](docs/accessibility.md) |
| 209 | +- [Best practices](docs/best-practices.md) |
| 210 | +- [Changelog](docs/changelog.md) |
| 211 | + |
| 212 | +[Full docs](https://hardikforall.github.io/MinimaCSS/docs/) · [Component showcase](https://hardikforall.github.io/MinimaCSS/examples/) · [Dashboard demo](https://hardikforall.github.io/MinimaCSS/examples/dashboard.html) |
| 213 | + |
| 214 | +## Browser support |
| 215 | + |
| 216 | +Baseline 2024+ — Safari 17.5+, Chrome 117+, Firefox 121+. Uses `light-dark()`, `color-mix()`, `@starting-style`, `transition-behavior: allow-discrete`, `:user-invalid`, `field-sizing`, container queries, cascade layers, `text-wrap: balance/pretty`, Popover API, and CSS Anchor Positioning. |
| 217 | + |
| 218 | +For older browsers, stay on [MinimaCSS 0.2](https://www.npmjs.com/package/minimacss/v/0.2.0). |
| 219 | + |
| 220 | +## Contributing |
| 221 | + |
| 222 | +```bash |
| 223 | +npm install |
| 224 | +npm run dev # watches SCSS + serves examples/ at http://localhost:4200 |
| 225 | +npm run lint # stylelint |
| 226 | +npm run build # produces dist/ with autoprefixer |
| 227 | +``` |
93 | 228 |
|
94 | | -- [ ] Create Documentation |
| 229 | +Open a PR. Linting and a clean build are required. |
95 | 230 |
|
96 | | -### Contributions |
| 231 | +## License |
97 | 232 |
|
98 | | -Contributions are welcome! If you'd like to improve MinimaCSS, feel free to fork the repository, make your changes, and submit a pull request. |
| 233 | +MIT. |
0 commit comments