Skip to content

Commit bcedaab

Browse files
authored
docs(misc): fix styling for custom tags (#32297)
Fix up styling for markdoc custom tags for Astro docs.
1 parent aeb1803 commit bcedaab

19 files changed

Lines changed: 63 additions & 32 deletions

astro-docs/src/components/markdoc/ProjectDetails.astro

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ import { type ProjectDetailsProps, ProjectDetails as Default } from '@nx/nx-dev-
33
type Props = ProjectDetailsProps;
44
---
55

6-
<Default client:visible {...Astro.props} isAstro={true}>
7-
<slot />
8-
</Default>
6+
<div class="pdv">
7+
<Default client:visible {...Astro.props} isAstro={true}>
8+
<slot />
9+
</Default>
10+
</div>
11+
12+
13+
<style>
14+
.pdv :global(ul) {
15+
list-style: none;
16+
padding: 0;
17+
}
18+
</style>

astro-docs/src/styles/global.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,15 @@
6060
--sl-color-gray-6: var(--color-slate-200);
6161
}
6262

63+
/* Adaptive icons, like GitHub logo, etc. */
64+
[data-theme='dark'] .adaptive-icon {
65+
filter: invert(1);
66+
}
67+
68+
[data-theme='light'] .adaptive-icon {
69+
fill: black;
70+
}
71+
6372
/* Custom font for code blocks */
6473
@font-face {
6574
font-family: 'Input Mono';
@@ -109,3 +118,7 @@ h6:hover .anchor-link {
109118
.content-panel + .content-panel {
110119
border-top: 0;
111120
}
121+
122+
iframe[src*='youtube'] {
123+
aspect-ratio: 16 / 9;
124+
}

nx-dev/ui-common/src/lib/button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const sizes: Record<AllowedSizes, string> = {
4242
*/
4343
function getLayoutClassName(className = ''): string {
4444
return cx(
45-
'group relative inline-flex opacity-100 focus:outline-none disabled:opacity-80 disabled:cursor-not-allowed transition',
45+
'group relative inline-flex opacity-100 focus:outline-none disabled:opacity-80 disabled:cursor-not-allowed transition no-underline',
4646
className
4747
);
4848
}

nx-dev/ui-markdoc/src/lib/tags/call-to-action.component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export function CallToAction({
7575
iconClasses.width,
7676
colorClasses.container,
7777
colorClasses.hoverText,
78-
'not-prose group relative mx-auto my-12 flex w-full items-center gap-3 overflow-hidden rounded-lg shadow-md transition'
78+
'not-content not-prose group relative mx-auto my-12 flex w-full items-center gap-3 overflow-hidden rounded-lg shadow-md transition'
7979
)}
8080
>
8181
<div
@@ -99,7 +99,7 @@ export function CallToAction({
9999
href={url}
100100
target="_blank"
101101
rel="noreferrer"
102-
className="block text-sm font-medium opacity-80"
102+
className="block text-sm font-medium text-white no-underline opacity-80"
103103
>
104104
<span className="absolute inset-0" aria-hidden="true"></span>
105105
{description || ''}

nx-dev/ui-markdoc/src/lib/tags/callout.component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export function Callout({
131131
return (
132132
<div
133133
className={cx(
134-
'my-6 overflow-hidden rounded-md border',
134+
'not-content my-6 overflow-hidden rounded-md border',
135135
ui.borderColor,
136136
ui.backgroundColor
137137
)}

nx-dev/ui-markdoc/src/lib/tags/cards.component.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function Cards({
7474
return (
7575
<div
7676
className={cx(
77-
'mt-8 grid gap-4',
77+
'not-content mt-8 grid gap-4',
7878
colsClasses[cols] || '',
7979
smColsClasses[smCols] || '',
8080
mdColsClasses[mdCols] || '',
@@ -136,7 +136,7 @@ export function LinkCard({
136136
{icon && (
137137
<div
138138
className={cx(
139-
'mb-2 flex h-24 w-24 items-center justify-center rounded-lg',
139+
'mb-2 flex h-24 w-24 items-center justify-center rounded-lg text-black dark:text-white',
140140
{
141141
'h-12 w-12': appearance === 'small',
142142
}
@@ -208,7 +208,7 @@ export function Card({
208208
key={title}
209209
href={url}
210210
title={title}
211-
className="group flex flex-col items-stretch rounded-md border border-slate-200 bg-slate-50/40 text-sm no-underline shadow-sm transition focus-within:ring-2 focus-within:ring-blue-500 focus-within:ring-offset-2 hover:bg-slate-50 dark:border-slate-800/40 dark:bg-slate-800/60 dark:hover:bg-slate-800"
211+
className="not-content group flex flex-col items-stretch rounded-md border border-slate-200 bg-slate-50/40 text-sm no-underline shadow-sm transition focus-within:ring-2 focus-within:ring-blue-500 focus-within:ring-offset-2 hover:bg-slate-50 dark:border-slate-800/40 dark:bg-slate-800/60 dark:hover:bg-slate-800"
212212
prefetch={false}
213213
>
214214
{!!hasYoutubeId && (

nx-dev/ui-markdoc/src/lib/tags/github-repository.component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export function GithubRepository({
1010
title,
1111
}: GithubRepositoryProps): JSX.Element {
1212
return (
13-
<div className="not-prose group relative mx-auto my-12 flex w-full max-w-md items-center gap-3 overflow-hidden rounded-lg bg-slate-50 shadow-md transition hover:text-white dark:bg-slate-800/60">
13+
<div className="not-content not-prose group relative mx-auto my-12 flex w-full max-w-md items-center gap-3 overflow-hidden rounded-lg bg-slate-50 shadow-md transition hover:text-white dark:bg-slate-800/60">
1414
<div className="absolute inset-0 z-0 w-2 bg-blue-500 transition-all duration-150 group-hover:w-full dark:bg-sky-500"></div>
1515
<div className="w-2 bg-blue-500 dark:bg-sky-500"></div>
1616

@@ -33,7 +33,7 @@ export function GithubRepository({
3333
href={url}
3434
target="_blank"
3535
rel="noreferrer"
36-
className="block text-sm font-medium opacity-80"
36+
className="block text-sm font-medium text-white no-underline opacity-80"
3737
>
3838
<span className="absolute inset-0" aria-hidden="true"></span>
3939
{url.replace(/^.*\/\/[^\/]+/, '')}

nx-dev/ui-markdoc/src/lib/tags/graph.component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export function Graph({
112112
}
113113

114114
return parsedProps ? (
115-
<div className="w-full place-content-center overflow-hidden rounded-md ring-1 ring-slate-200 dark:ring-slate-700">
115+
<div className="not-content w-full place-content-center overflow-hidden rounded-md ring-1 ring-slate-200 dark:ring-slate-700">
116116
<div className="relative flex justify-center border-b border-slate-200 bg-slate-100/50 p-2 font-bold dark:border-slate-700 dark:bg-slate-700/50">
117117
{title}
118118
</div>

nx-dev/ui-markdoc/src/lib/tags/iframe.component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export function Iframe(props: IframeProps) {
1010
{...props}
1111
title={props.title}
1212
frameBorder="0"
13-
className="rounded-lg border border-slate-200 shadow-lg shadow-lg dark:border-slate-700"
13+
className="not-content rounded-lg border border-slate-200 shadow-lg shadow-lg dark:border-slate-700"
1414
/>
1515
);
1616
}

nx-dev/ui-markdoc/src/lib/tags/install-nx-console.component.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ChevronRightIcon } from '@heroicons/react/24/outline';
22

33
export const InstallNxConsole = () => (
4-
<div className="my-12 grid grid-cols-1 gap-6 lg:grid-cols-2 lg:gap-16">
4+
<div className="not-content my-12 grid grid-cols-1 gap-6 lg:grid-cols-2 lg:gap-16">
55
{/* VSCode */}
66
<div className="not-prose group relative mx-auto flex w-full max-w-md items-center gap-4 overflow-hidden rounded-lg bg-slate-50 shadow-md transition hover:text-white dark:bg-slate-800/60">
77
<div className="absolute inset-0 z-0 w-2 bg-blue-500 transition-all duration-150 group-hover:w-full dark:bg-sky-500" />
@@ -26,7 +26,7 @@ export const InstallNxConsole = () => (
2626
href="https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console"
2727
target="_blank"
2828
rel="noreferrer"
29-
className="block text-xs font-medium opacity-80"
29+
className="block text-xs font-medium text-black no-underline opacity-80 dark:text-white"
3030
>
3131
<span className="absolute inset-0" aria-hidden="true"></span>
3232
The official VSCode extension for Nx.
@@ -60,7 +60,7 @@ export const InstallNxConsole = () => (
6060
href="https://plugins.jetbrains.com/plugin/21060-nx-console"
6161
target="_blank"
6262
rel="noreferrer"
63-
className="block text-xs font-medium opacity-80"
63+
className="block text-xs font-medium text-black no-underline opacity-80 dark:text-white"
6464
>
6565
<span className="absolute inset-0" aria-hidden="true"></span>
6666
Available for WebStorm, IntelliJ IDEA Ultimate and more!

0 commit comments

Comments
 (0)