File tree 10 files changed +40
-15
lines changed
10 files changed +40
-15
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ export default function webcConfig(eleventyConfig) {
19
19
// any `.webc` files found in the top-level of our `includes` directory
20
20
// or in the `components` directory inside of our `includes` directory
21
21
// will be processed as global webc components.
22
- components : `${ config . dir . input } /${ config . dir . includes } /components/*.webc` ,
22
+ components : [
23
+ `${ config . dir . input } /${ config . dir . includes } /components/*.webc` ,
24
+ `${ config . dir . input } /${ config . dir . includes } /elements/*.webc` ,
25
+ ] ,
23
26
} ) ;
24
27
}
Original file line number Diff line number Diff line change 54
54
- [ tailwindcss as a utility generator with eleventy] ( https://eleventy-excellent.netlify.app/blog/what-is-tailwind-css-doing-here/ )
55
55
- [ tailwindcss v4 alpha] ( https://tailwindcss.com/blog/tailwindcss-v4-alpha#try-out-the-alpha )
56
56
- [ relevant 11ty Serverless plugin code that helped me figure out how to use the programmatic api to generate a page] ( https://github.com/11ty/eleventy/blob/v2.x/src/Serverless.js#L160 )
57
+ - [ show all links to external pages from jim nielsen's blog] ( https://blog.jim-nielsen.com/about/external-links )
57
58
58
59
## webc
59
60
Original file line number Diff line number Diff line change 60
60
61
61
& a {
62
62
text-transform: lowercase;
63
- text-decoration: none;
63
+ text-decoration-line : none;
64
64
}
65
65
66
66
& a:is(:hover, :active, :focus-visible) {
67
- text-decoration: underline;
67
+ text-decoration-line : underline;
68
68
}
69
69
}
70
70
Original file line number Diff line number Diff line change
1
+ <script webc:type='render'>
2
+ function() {
3
+ if (!this.alt) {
4
+ throw new Error("Need to have an `alt` attribute for the <img> tag.");
5
+ }
6
+ return `<img src="${this.src}" alt="${this.alt}">`;
7
+ }
8
+ </script>
Original file line number Diff line number Diff line change 83
83
84
84
& > a {
85
85
color: var(--color-primary);
86
- text-decoration: none;
86
+ text-decoration-line : none;
87
87
88
88
&:hover {
89
- text-decoration: underline;
89
+ text-decoration-line : underline;
90
90
}
91
91
}
92
92
}
Original file line number Diff line number Diff line change 4
4
5
5
<ul>
6
6
<li webc:for="link of socials">
7
- <a rel="noreferrer" :href="link.href" @text="link.text"></a>
7
+ <a :href="link.href" @text="link.text"></a>
8
8
</li>
9
9
</ul>
10
10
11
11
<p>
12
12
<span @text="p1[0]"></span>
13
- <a href="https://www.vincit.com" rel="noreferrer" @text="p1[1]"></a>
13
+ <a href="https://www.vincit.com" @text="p1[1]"></a>
14
14
<span @text="p1[2]"></span>
15
15
</p>
16
16
<p>
Original file line number Diff line number Diff line change 9
9
10
10
<ul webc:if="projects.length > 0">
11
11
<li webc:for="project of projects">
12
- <a :href='project.url' rel="noreferrer" >
12
+ <a :href='project.url'>
13
13
<h2 @text='`~/${project.name}`'></h2>
14
14
<p @text='project.description'></p>
15
15
</a>
45
45
padding: 0.6em 0.9em;
46
46
margin-inline: -0.9em;
47
47
48
- text-decoration: none;
48
+ text-decoration-line: none;
49
+
50
+ /* disable icon on external link, but put it on the first child of the link */
51
+ &:after {
52
+ content: none;
53
+ }
54
+ &:first-child :after {
55
+ content: ' \2197';
56
+ }
49
57
50
58
&:focus-visible {
51
59
outline-color: var(--color-primary);
55
63
56
64
h2 {
57
65
font-size: var(--font-size-lg);
58
-
59
66
}
60
67
&:hover h2 {
61
68
color: var(--color-primary);
Original file line number Diff line number Diff line change 54
54
color : var (--color-primary );
55
55
}
56
56
}
57
+ /* show icons for external and mailto: links */
58
+ a [href ^= 'http' ]: after {
59
+ content : ' \2197' ;
60
+ }
61
+ a [href ^= 'mailto:' ]: after {
62
+ content : ' \2709' ;
63
+ }
57
64
58
65
/*
59
66
* but if they're in an paragraph or are anchor links inside of a heading on one
@@ -71,7 +78,7 @@ a[data-anchor="true"] {
71
78
72
79
/* override tailwind default of no underline for links */
73
80
a {
74
- text-decoration : underline;
81
+ text-decoration-line : underline;
75
82
text-decoration-thickness : 2px ;
76
83
}
77
84
/* disable link underline by default if it's a direct child of a heading element */
Original file line number Diff line number Diff line change @@ -33,12 +33,12 @@ main {
33
33
34
34
a {
35
35
font-size : var (--font-size-md );
36
- text-decoration : none;
36
+ text-decoration-line : none;
37
37
max-width : 32ch ;
38
38
39
39
& : hover ,
40
40
& : focus-visible {
41
- text-decoration : underline;
41
+ text-decoration-line : underline;
42
42
}
43
43
}
44
44
74
74
var (--padding-block-size ) + var (--padding-inline-size ) +
75
75
var (--tag-hole-punch-size )
76
76
);
77
- text-decoration : none;
77
+ text-decoration-line : none;
78
78
position : relative;
79
79
/* clips the element to match the ::before element's path, otherwise
80
80
* the background color of this element will escape the bounds
Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ plugins: [
24
24
## downsides/gripes
25
25
- css grid kinda sucks with tailwind
26
26
- to use the power of grid, you just need to use bespoke CSS (i.e. `grid-template-areas` and `grid-area: *`)
27
- -
28
27
- logical properties support is half-assed
29
28
- why don't you just update `ml-*` / `pt-*` / etc utilities under the hood to use logical properties ??
30
29
- no `-block-` logical property utilities due to (understandable) naming collision with `-bottom` utilities
You can’t perform that action at this time.
0 commit comments