@anydigital/blades 0.27.0-beta.8 → 0.28.0-alpha
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/README.md +46 -97
- package/_includes/blades/html.liquid +1 -1
- package/_includes/blades/html.njk +1 -1
- package/assets/blades.core.css +611 -0
- package/assets/blades.css +285 -75
- package/assets/blades.theme.css +60 -10
- package/assets/breakout.css +7 -2
- package/assets/float-label.core.css +44 -0
- package/assets/float-label.css +76 -0
- package/assets/float-label.theme.css +31 -0
- package/assets/link-icon.css +55 -0
- package/assets/responsive-table.css +9 -6
- package/blades.gemspec +1 -1
- package/package.json +3 -1
- package/src/_layout.css +19 -17
- package/src/_table.css +3 -2
- package/src/_typography.css +17 -9
- package/src/_unreduce-motion.css +6 -3
- package/src/_utilities.css +4 -17
- package/src/blades.core.css +18 -0
- package/src/blades.css +2 -15
- package/src/blades.theme.css +33 -1
- package/src/breakout.css +7 -2
- package/src/float-label.core.css +44 -0
- package/src/float-label.css +3 -0
- package/src/float-label.theme.css +31 -0
- package/src/link-icon.css +55 -0
- package/src/responsive-table.css +9 -6
- package/src/_link.css +0 -47
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/* Extends https://github.com/picocss/pico/blob/main/scss/content/_link.scss
|
|
2
|
+
<!--section:code-->
|
|
3
|
+
```css */
|
|
4
|
+
a {
|
|
5
|
+
/* Use inline flex only if link contains an icon */
|
|
6
|
+
&:has(> i) {
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
gap: 0.375ch; /* =3/8 */
|
|
9
|
+
overflow-y: clip; /* to work in pair with text-underline-offset in Safari */
|
|
10
|
+
}
|
|
11
|
+
> i {
|
|
12
|
+
font-style: normal;
|
|
13
|
+
float: left; /* ✅ Chrome ❌ Safari */
|
|
14
|
+
text-underline-offset: -2em; /* ❌ Chrome ✅ Safari - to clip it with overflow-y */
|
|
15
|
+
|
|
16
|
+
/* Favicons */
|
|
17
|
+
> img {
|
|
18
|
+
height: 1.25em;
|
|
19
|
+
margin-block: calc(-0.25em / 2);
|
|
20
|
+
display: inline-block; /* for Tailwind CSS Typography */
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* Font Awesome */
|
|
24
|
+
&[class^="fa-"],
|
|
25
|
+
&[class*=" fa-"] {
|
|
26
|
+
line-height: inherit;
|
|
27
|
+
--fa-width: auto;
|
|
28
|
+
}
|
|
29
|
+
&.fa-lg {
|
|
30
|
+
line-height: normal;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/*```
|
|
35
|
+
> **PRO-TIP** for 11ty: https://blades.ninja/build-awesome-11ty/processors/#auto-link-favicons
|
|
36
|
+
|
|
37
|
+
<!--section:docs,summary-->
|
|
38
|
+
|
|
39
|
+
Use Blades' `<i>`-helper to wrap emojis, favicons, or simply drop Font Awesome icons inside links. It automatically handles sizing and alignment while preventing underline on icons.
|
|
40
|
+
|
|
41
|
+
<!--section:docs-->
|
|
42
|
+
|
|
43
|
+
Compare:
|
|
44
|
+
|
|
45
|
+
| Without Blades <hr class="lg"> | With Blades' `<i>`-helper <hr class="lg"> | Clean HTML without `<span>ning` <hr class="x2"> |
|
|
46
|
+
| ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- |
|
|
47
|
+
| [🥷 Link with emoji](#) | [<i>🥷</i> Link with emoji](#) | `<a><i>🥷</i> Text</a>` |
|
|
48
|
+
| [ Multi-line link <br> with favicon](#) | [<i></i> Multi-line link <br> with favicon](#) | `<a><i><img src="..."></i> Text</a>` |
|
|
49
|
+
| [<b class="fa-brands fa-github fa-lg"></b> Link with Font Awesome icon](#) | [<i class="fa-brands fa-github fa-lg"></i> Link with Font Awesome icon](#) | `<a><i class="fa-..."></i> Text</a>` |
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
[How we made it ↗ <small>(on Codepen)</small>](https://codepen.io/editor/anydigital/pen/019d2b94-5616-75dc-a23e-e111869d5237){role=button .outline}
|
|
54
|
+
|
|
55
|
+
<!--section--> */
|
package/src/responsive-table.css
CHANGED
|
@@ -29,21 +29,24 @@ Soft-increase selector specificity trick:
|
|
|
29
29
|
|
|
30
30
|
`table:not(.does-not-exist)` (inspired by postcss) is used here to increase specificity against selectors like `&:is(table, .table)`
|
|
31
31
|
|
|
32
|
-
<!--section:docs-->
|
|
32
|
+
<!--section:docs,summary-->
|
|
33
|
+
|
|
34
|
+
`<table class="responsive">` allows a table to full-bleed and scroll on mobile.
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
<hr><div>
|
|
36
|
+
<!--section:docs-->
|
|
36
37
|
|
|
37
|
-
| Term
|
|
38
|
-
|
|
|
38
|
+
| Term | Description <hr class="x2"> | Link |
|
|
39
|
+
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
|
|
39
40
|
| Responsive design | Approach to web design that aims to make web pages render well on a variety of devices and window or screen sizes from minimum to maximum display size to ensure usability and satisfaction. | https://en.wikipedia.org/wiki/Responsive_web_design |
|
|
40
41
|
|
|
41
42
|
{.responsive}
|
|
42
|
-
|
|
43
|
+
|
|
44
|
+
---
|
|
43
45
|
|
|
44
46
|
Tables inside https://blades.ninja/css/breakout/ are responsive by default.
|
|
45
47
|
|
|
46
48
|
Living examples:
|
|
49
|
+
|
|
47
50
|
- https://any.digital/insights/ai-ide/
|
|
48
51
|
- https://any.digital/insights/css-frameworks/
|
|
49
52
|
- https://any.digital/insights/ssg/
|
package/src/_link.css
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/* Extends https://github.com/picocss/pico/blob/main/scss/content/_link.scss
|
|
2
|
-
<!--section:code-->
|
|
3
|
-
```css */
|
|
4
|
-
a {
|
|
5
|
-
/* Helper to handle icons in links */
|
|
6
|
-
> i {
|
|
7
|
-
display: inline-block;
|
|
8
|
-
font-style: normal;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/* Helper for favicons in links */
|
|
12
|
-
&[data-has-favicon] {
|
|
13
|
-
display: inline-block;
|
|
14
|
-
|
|
15
|
-
> img {
|
|
16
|
-
max-height: 1.25em;
|
|
17
|
-
margin-top: calc(-0.25em / 2);
|
|
18
|
-
margin-inline-end: 0.375ch; /* =3/8 */
|
|
19
|
-
|
|
20
|
-
/* for tw-typography (.prose) */
|
|
21
|
-
display: inline-block;
|
|
22
|
-
margin-bottom: 0;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
/*```
|
|
27
|
-
> **PRO-TIP** for 11ty: https://blades.ninja/build-awesome-11ty/processors/#auto-link-favicons
|
|
28
|
-
|
|
29
|
-
<!--section:docs-->
|
|
30
|
-
|
|
31
|
-
### Link [fav]icons
|
|
32
|
-
|
|
33
|
-
Wrap icons inside links using `<i>... </i>` helper to avoid underline. Compare:
|
|
34
|
-
|
|
35
|
-
<big class="grid">
|
|
36
|
-
<article><a href="https://github.com/anydigital/blades"> 🥷 Blades</a></article>
|
|
37
|
-
<article><a href="https://github.com/anydigital/blades"><i>🥷 </i>Blades</a></article>
|
|
38
|
-
</big>
|
|
39
|
-
|
|
40
|
-
Use `data-has-favicon` helper attribute on plain-text links containing `<img>`-favicon for better alignment. Compare:
|
|
41
|
-
|
|
42
|
-
<big class="grid">
|
|
43
|
-
<article><a href="https://github.com/anydigital/blades" ><img src="https://www.google.com/s2/favicons?domain=github.com&sz=64">/anydigital/blades</a></article>
|
|
44
|
-
<article><a href="https://github.com/anydigital/blades" data-has-favicon><img src="https://www.google.com/s2/favicons?domain=github.com&sz=64">/anydigital/blades</a></article>
|
|
45
|
-
</big>
|
|
46
|
-
|
|
47
|
-
<!--section--> */
|