Skip to content

Commit fff382a

Browse files
committed
Update Callout stylings
1 parent 8b78fda commit fff382a

10 files changed

Lines changed: 506 additions & 49 deletions

File tree

‎_TODO.md‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,10 @@ https://mermaid.js.org/config/directives.html
172172

173173
- There's a pretty long delay when you push the Content Switcher to go from short to deep dive, what's causing it? It should be fast - maybe it's a prefetch issue, prefetch on page load
174174

175-
- Suggestions on improving table layout for better visual experience
175+
- Suggestions on improving table layout for better visual experience. Consider adding a trim outline to tables
176176

177177
- Cap callout length at 80% or 90% of the column so they're not longer than any text
178178

179-
- Consider adding a trim outline to tables
180-
181-
- Social share shouldn't appear on deep dive
182-
183179
- Themepicker and search icon are too big in non-squished header. Logo too - the initial presentation should be smaller.
184180

185181
- Search box in header should have blue outline, not highlight
@@ -188,6 +184,8 @@ https://mermaid.js.org/config/directives.html
188184

189185
- Hero animation not loading on home page.
190186

187+
- Improve `<abbr>` styling: https://codepen.io/ire/pen/NoqWpm
188+
191189
## List Component
192190

193191
- Task list checked variant Markdown in dark theme is awkward, it has a dark shadow

‎astro.config.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const standardIntegrations = [
6969
})] : []),
7070
sitemap({
7171
serialize: createSerializeFunction({
72-
exclude: ['downloads', '/articles/demo', 'testing', 'terms', 'hero', 'links'],
72+
exclude: ['deep-dive', 'downloads', '/articles/demo', 'testing', 'hero', 'links'],
7373
}),
7474
}),
7575
/**

‎src/components/CallToAction/Newsletter/layouts/article.astro‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ const buttonText = 'Subscribe'
1010
---
1111

1212
<section class="mb-4 md:mb-6">
13-
<div class="bg-content border border-trim rounded-xl p-6 md:p-8 font-mono">
14-
<div class="flex items-center gap-2 mb-4 pb-4 border-b border-page-base/20">
13+
<div class="bg-content border border-trim rounded-xl px-5 py-4 font-mono">
14+
<div class="flex items-center gap-2 mb-3 pb-3 border-b border-page-base/20">
1515
<div class="w-3 h-3 rounded-full bg-danger"></div>
1616
<div class="w-3 h-3 rounded-full bg-warning"></div>
1717
<div class="w-3 h-3 rounded-full bg-success"></div>
1818
<span class="text-xs text-page-base/50 ml-2">newsletter.subscribe</span>
1919
</div>
2020

21-
<div class="space-y-3">
21+
<div class="space-y-2">
2222
<p class="text-page-base">
2323
<span class="text-success">$</span>
2424
{` ${title}`}

‎src/components/Callout/index.astro‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,17 @@ const iconColor = accentTextClasses.startsWith('text-') ? accentTextClasses.slic
7878
<div
7979
class:list={[
8080
containerClasses,
81-
'callout',
8281
'flex',
8382
'flex-col',
8483
'gap-3',
8584
'mt-4',
8685
'mb-8',
87-
'p-4',
86+
'py-4',
87+
'pl-6',
88+
'pr-10',
8889
'border-0',
8990
'border-l-[6px]',
90-
'rounded-none',
91+
'rounded-r-lg',
9192
]}
9293
role="note"
9394
>

‎src/components/Table/index.astro‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
import DefaultTable from '@components/Table/layouts/default.astro'
3+
4+
export type Props = {
5+
content: {
6+
caption?: string
7+
subcaption?: string
8+
thead?: {
9+
th: string[]
10+
}
11+
tbody: {
12+
tr: {
13+
th?: string
14+
td: string[]
15+
}[]
16+
}
17+
tfoot?: {
18+
tr: {
19+
th?: string
20+
td: string[]
21+
}[]
22+
}
23+
}
24+
classes?: {
25+
table?: string
26+
caption?: string
27+
thead?: string
28+
tbody?: string
29+
tfoot?: string
30+
}
31+
variant: string
32+
}
33+
34+
const { content, variant = 'default', classes } = Astro.props
35+
const classesProps = classes ? { classes } : {}
36+
---
37+
38+
{variant === 'default' && <DefaultTable content={content} {...classesProps} />}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
export type Props = {
3+
content: {
4+
caption?: string
5+
subcaption?: string
6+
thead?: {
7+
th: string[]
8+
}
9+
tbody: {
10+
tr: {
11+
th?: string
12+
td: string[]
13+
}[]
14+
}
15+
tfoot?: {
16+
tr: {
17+
th?: string
18+
td: string[]
19+
}[]
20+
}
21+
}
22+
classes?: {
23+
table?: string
24+
caption?: string
25+
thead?: string
26+
tbody?: string
27+
tfoot?: string
28+
}
29+
}
30+
31+
const { content, classes }: Props = Astro.props
32+
33+
const tableClass = ""
34+
const captionClass = ""
35+
const headerClass = ""
36+
const textClass = ""
37+
const theadClass = ""
38+
const tbodyClass = ""
39+
const tfootClass = ""
40+
---
41+
42+
<table class:list={[tableClass, classes?.table]}>
43+
{content.caption && (
44+
<caption class:list={[captionClass, classes?.caption]} set:html={content.caption}></caption>
45+
)}
46+
{content.subcaption && (
47+
<caption class:list={[captionClass, classes?.caption]} set:html={content.subcaption}></caption>
48+
)}
49+
50+
{content.thead && (
51+
<thead class:list={[theadClass, classes?.thead]}>
52+
<tr>
53+
{content.thead.th.map((th) => (
54+
<th scope="col" class:list={[headerClass, classes?.thead]} set:html={th}></th>
55+
))}
56+
</tr>
57+
</thead>
58+
)}
59+
60+
<tbody class:list={[tbodyClass, classes?.tbody]}>
61+
{content.tbody.tr.map((row) => (
62+
<tr>
63+
{row.th && (
64+
<th scope="row" class:list={[headerClass, classes?.tbody]} set:html={row.th}></th>
65+
)}
66+
{row.td.map((td) => (
67+
<td class:list={[textClass, classes?.tbody]} set:html={td}></td>
68+
))}
69+
</tr>
70+
))}
71+
</tbody>
72+
73+
{content.tfoot && (
74+
<tfoot class:list={[tfootClass, classes?.tfoot]}>
75+
{content.tfoot.tr.map((row) => (
76+
<tr>
77+
{row.th && (
78+
<th scope="row" class:list={[headerClass, classes?.tfoot]} set:html={row.th}></th>
79+
)}
80+
{row.td.map((td) => (
81+
<td class:list={[textClass, classes?.tfoot]} set:html={td}></td>
82+
))}
83+
</tr>
84+
))}
85+
</tfoot>
86+
)}
87+
</table>

‎src/lib/markdown/plugins/rehype-tailwind/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export function rehypeTailwindClasses() {
129129
if (node.tagName === 'figure' && !hasClass(node, 'blockquote')) {
130130
node.properties = node.properties || {}
131131
node.properties['className'] = ((node.properties['className'] as string[]) || []).concat([
132-
'my-8',
132+
'my-4',
133133
'mx-auto',
134134
'max-w-none',
135135
])

‎src/lib/markdown/plugins/rehype-tailwind/visitors/simple.ts‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,6 @@ export const htmlElements: ElementConfig[] = [
2525
'h-px',
2626
],
2727
},
28-
{
29-
tagName: 'img',
30-
classes: [
31-
'block',
32-
'mx-auto',
33-
'mb-6',
34-
'max-w-full',
35-
'h-auto',
36-
'rounded-lg',
37-
'shadow-md',
38-
'text-gray-500',
39-
'italic',
40-
'text-center',
41-
],
42-
},
4328
{
4429
tagName: 'mark',
4530
classes: [

0 commit comments

Comments
 (0)