Get started Standalone versions
Most of internal Blades CSS modules are available as standalone helpers, giving you flexibility to use them with other CSS frameworks:
| Module | CDN | Import from NPM |
|---|---|---|
| Breakout container | N/A | |
| Link icon | N/A | |
| Responsive table | N/A | |
| Float labels |
npm install @anyblades/blades @import "@anyblades/blades/float-label"; |
|
| All above together | npm install @anyblades/blades @import "@anyblades/blades/standalone"; |
|
| Reset/normalizer |
npm install @anyblades/pico @import "@anyblades/pico"; |
|
| Experimental "ninja" add-ons | npm install @anyblades/blades @import "@anyblades/blades/ninja"; |
Live examples:
www.mattanger.dev (Link icon via CDN)
blades.standalone.css #
There are 4 ways to get started:
A. Install manually #
Download CSS archive and link
css/blades.standalone.css in the <head> of your website.
<link rel="stylesheet" href="css/blades.standalone.css" />
B. Usage from CDN #
<link rel="stylesheet" href="
https://cdn.jsdelivr.net/npm/@anyblades/blades@2/css/blades.standalone.min.css
"/>
Live example: /pallets/website/blob/main/src/pallets/templates/layout.html
Full list of CSS files available on CDN: /npm/@anyblades/blades@2/css
C. Starter projects #
subtle.blades.ninja 11ty micro-starter
start.11ty.blades.ninja 7-in-1 starter (including Tailwind)
getgrav.org v2 now features Blades CSS in its default theme (Quark2)
jekyll.blades.ninja starter
D. Install with NPM #
npm install @anyblades/blades
You can use precompiled Pico+Blades CSS (same as CDN version):
<link rel="stylesheet" href="
node_modules/@anyblades/blades/css/blades.standalone.css
" />
Or import standalone Blades CSS sources (without Pico CSS):
@import "@anyblades/blades/standalone";
Live example using Tailwind: /anyblades/buildawesome-starters/blob/main/site-tailwind/styles.css
To install and import both Pico+Blades CSS sources at once:
npm install @anyblades/pico @anyblades/blades
@import "@anyblades/pico";
@import "@anyblades/blades/standalone";
This is exactly how Blades CSS is built itself: /anyblades/blades/blob/main/src/blades.css
Appendix #
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="css/blades.standalone.css" />
<title>Hello world!</title>
</head>
<body>
<main class="container">
<h1>Hello world!</h1>
</main>
</body>
</html>
Core unthemed versions #
Most of internal Blades CSS modules are also available unthemed:
How it works
/anyblades/blades/refs/heads/main/src/blades.standalone.core.css :
/* Follows https://github.com/picocss/pico/blob/main/scss/_index.scss */
@import "./_variables";
/* Layout */
@import "./_layout";
@import "./breakout";
/* Content */
@import "./content/_typography";
@import "./link-icon";
@import "./content/_table";
@import "./responsive-table";
@import "./content/_code";
/* Forms */
@import "./float-label.core";
/* Components */
@import "./components/_timeline";
/* Utilities */
@import "./_utilities";
How it works
/anyblades/blades/refs/heads/main/src/blades.standalone.theme.css :
@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,
h2,
h3,
h4,
h5,
h6 {
text-wrap: balance;
}
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%;
}
}
dl {
dt {
margin-block: 0.25rem;
font-weight: 500;
}
dd {
margin-block-end: 1rem;
}
}
pre {
small {
opacity: 75%;
font-weight: lighter;
}
&:has(code) {
background: #181c25 !important;
}
}
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;
}
}