Get started Standalone version
There are 4 ways to get started:
Install manually #
Download Blades and link assets/blades.standalone.css in the <head> of your website.
<link rel="stylesheet" href="assets/blades.standalone.css" />
Usage from CDN #
Alternatively, you can use jsDelivr CDN to link assets/blades.standalone.min.css:
<link rel="stylesheet" href="
https://cdn.jsdelivr.net/npm/@anyblades/blades@2/assets/blades.standalone.min.css
"/>
Living examples: /anyblades/subtle/blob/main/.subtle/package.json
Install with NPM #
npm install @anyblades/pico # optional
npm install @anyblades/blades
Then, import [Pico] and Blades into your CSS:
@import "@anyblades/pico"; /* optional */
@import "@anyblades/blades"; /* can be used standalone */
Living example: /anyblades/build-awesome-starter/blob/main/_styles/styles.css
Starter HTML template #
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="color-scheme" content="light dark" />
<link rel="stylesheet" href="assets/blades.standalone.css" />
<title>Hello world!</title>
</head>
<body>
<main class="container">
<h1>Hello world!</h1>
</main>
</body>
</html>
Blades does not replace other frameworks, but empowers them instead:
| Tailwind | Blades 🥷 | Tailwind+Blades 🥷 | ✨ Pico | ✨ Pico+Blades 🥷 | Bootstrap | |
|---|---|---|---|---|---|---|
| Type: | Utility-first | Class-light | Hybrid | Class-light | Class-light | Component-based |
| Written in: | JavaScript | Modern CSS | Hybrid | SCSS | Modern CSS | SCSS |
| CSS base: | modern-normalize preflight |
⇢ Inherited | modern-normalize preflight |
normalize sanitize |
normalize sanitize |
normalize reboot |
| Layout: | ☑️ CSS primitives | ⇢ Inherited | ☑️ CSS primitives | ☑️ Basic grid | ☑️ Basic grid | ✅ |
| Text columns: | ☑️ CSS primitives | ✅ Docs | ✅ | ❌ | ✅ | ❌ |
| Breakout layout: | ❌ | ✅ Docs | ✅ | ❌ | ✅ | ❌ |
| Typography: | ✅ Plugin | ⇢ Inherited | ✅ Plugin | ✅ | ✅ | ✅ |
| Responsive tables without wrapper: | ❌ | ✅ Docs | ✅ | ❌ | ✅ | ❌ |
| Forms: | ✅ Plugin | ⇢ Inherited | ✅ Plugin | ✅ | ✅ | ✅ |
| Float labels: | ❌ | ✅ Docs | ✅ | ❌ | ✅ | ✅ |
Theme #
How it works
@import "./float-label.theme";
html {
/* Prevent horizontal overflow and scrolling, modern way. */
overflow-x: clip;
/* Enable font smoothing */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
body {
/* Ensure `body` takes at least the full height of the viewport (using dynamic viewport height for better mobile support). */
min-height: 100dvh;
/* Make the `body` a flex container with column layout, and `main` to automatically fill available space. This is useful for creating sticky footers and full-height layouts. */
display: flex;
flex-direction: column;
> main {
flex-grow: 1;
}
/* Evaluates the last ~4 lines of text blocks to prevent a single word from sitting on the final line. */
text-wrap: pretty;
/* Enable global hyphenation */
hyphens: auto;
/* ... except for links and tables which are better (safer) without hyphenation */
a,
table {
hyphens: none;
}
}
a {
&:not([href^="#"]) {
text-decoration-thickness: 1px;
&:hover {
text-decoration-thickness: 2px;
}
}
}
h1 {
font-size: 2.5em; /* for pico.css & tw-typography */
margin-bottom: 1rem; /* for tw-typography */
}
hr {
margin-block: 2em; /* for pico.css & tw-typography */
}
ul {
ul {
font-size: 87.5%;
}
}
pre {
small {
opacity: 75%;
font-weight: lighter;
}
}
table {
th {
vertical-align: bottom;
font-weight: bold;
}
td {
vertical-align: top;
}
pre {
margin-bottom: 0.25rem;
}
}
[data-jump-to="top"] {
opacity: 25%;
&:hover {
opacity: 75%;
}
> i {
display: inline-block;
padding: 0.25rem 0.375rem;
margin: 0.5rem;
font-size: 0.75rem;
color: black;
border-color: black;
}
}
.breakout,
.breakout-all {
> img,
> figure {
margin-bottom: 1rem;
}
}
.faded {
a {
text-decoration-style: dotted;
}
}