From d566da409d1d6f66e2be1a03136f61347f080634 Mon Sep 17 00:00:00 2001 From: Thiago Teixeira Date: Thu, 12 Dec 2024 15:46:28 -0800 Subject: [PATCH 1/7] Change inline code styling. --- styles/text.scss | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/styles/text.scss b/styles/text.scss index ed2feab15..5288649dc 100644 --- a/styles/text.scss +++ b/styles/text.scss @@ -109,8 +109,12 @@ button:focus-visible { /* Inline code blocks */ p > code, -li > code { - @apply border border-gray-40 dark:border-gray-80 text-red-70 rounded-md px-1 mx-1 break-words; +li > code, +/* Inline code blocks in docstrings */ +tt.docutils.literal { + @apply border-b px-1 rounded break-words; + @apply text-green-80 bg-gray-10 border-gray-30; + @apply dark:text-green-40 dark:bg-gray-90 dark:border-gray-100; } p a code { @@ -121,8 +125,3 @@ p a code { div.code-desc { @apply mb-4 text-gray-90 dark:text-gray-40; } - -/* Inline code blocks in docstrings */ -tt.docutils.literal { - @apply border border-gray-40 text-red-70 rounded-md px-1 mx-1 break-words; -} From 5bae17db63f506e4bcf6b249b335366ab7b66d7d Mon Sep 17 00:00:00 2001 From: Thiago Teixeira Date: Mon, 16 Dec 2024 11:51:10 -0800 Subject: [PATCH 2/7] Volley #1 with Jess --- styles/text.scss | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/styles/text.scss b/styles/text.scss index 5288649dc..426c02ab8 100644 --- a/styles/text.scss +++ b/styles/text.scss @@ -112,9 +112,10 @@ p > code, li > code, /* Inline code blocks in docstrings */ tt.docutils.literal { - @apply border-b px-1 rounded break-words; - @apply text-green-80 bg-gray-10 border-gray-30; - @apply dark:text-green-40 dark:bg-gray-90 dark:border-gray-100; + @apply break-words px-1 rounded; + @apply text-green-80 bg-gray-10; + @apply dark:text-green-50 dark:bg-gray-90; + @apply text-base; } p a code { From b19cbd115470c654e1762fae737b43625917dbf9 Mon Sep 17 00:00:00 2001 From: Thiago Teixeira Date: Mon, 16 Dec 2024 11:58:27 -0800 Subject: [PATCH 3/7] Volley #2 with Jess. --- styles/text.scss | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/styles/text.scss b/styles/text.scss index 426c02ab8..1dcc52e97 100644 --- a/styles/text.scss +++ b/styles/text.scss @@ -118,6 +118,16 @@ tt.docutils.literal { @apply text-base; } +/* Improve `code` links. Don't use border, use underline instead. */ +p > a:has(tt.docutils.literal) { + @apply border-0; +} + +/* Improve `code` links. Don't use border, use underline instead. */ +p > a > tt.docutils.literal { + @apply underline; +} + p a code { @apply border-none p-0; } From 4a823cbfe7ddf1a1ebbdc97ba2711a5f8be112be Mon Sep 17 00:00:00 2001 From: Thiago Teixeira Date: Mon, 16 Dec 2024 15:03:48 -0800 Subject: [PATCH 4/7] Fix code links inside non-p elements. --- styles/text.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/styles/text.scss b/styles/text.scss index 1dcc52e97..6d4d95ecb 100644 --- a/styles/text.scss +++ b/styles/text.scss @@ -119,12 +119,12 @@ tt.docutils.literal { } /* Improve `code` links. Don't use border, use underline instead. */ -p > a:has(tt.docutils.literal) { +a:has(tt.docutils.literal) { @apply border-0; } /* Improve `code` links. Don't use border, use underline instead. */ -p > a > tt.docutils.literal { +a > tt.docutils.literal { @apply underline; } From e8f34cdd8cfbb16cb755c9e405e914c4d4aac531 Mon Sep 17 00:00:00 2001 From: Thiago Teixeira Date: Mon, 16 Dec 2024 15:47:05 -0800 Subject: [PATCH 5/7] Make inline code changes less specific and apply to too --- styles/text.scss | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/styles/text.scss b/styles/text.scss index 6d4d95ecb..727f904aa 100644 --- a/styles/text.scss +++ b/styles/text.scss @@ -119,12 +119,14 @@ tt.docutils.literal { } /* Improve `code` links. Don't use border, use underline instead. */ -a:has(tt.docutils.literal) { +a:has(tt:only-child), +a:has(code:only-child) { @apply border-0; } /* Improve `code` links. Don't use border, use underline instead. */ -a > tt.docutils.literal { +a > tt:only-child, +a > code:only-child { @apply underline; } From 979b2246ee8c7a9ba43ef142993c8e2c31048931 Mon Sep 17 00:00:00 2001 From: Thiago Teixeira Date: Mon, 16 Dec 2024 17:15:29 -0800 Subject: [PATCH 6/7] Fix comments --- components/blocks/callout.module.css | 4 ---- components/layouts/container.module.css | 6 ++++++ styles/text.scss | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/components/blocks/callout.module.css b/components/blocks/callout.module.css index 4d1ae136e..9881364ef 100644 --- a/components/blocks/callout.module.css +++ b/components/blocks/callout.module.css @@ -7,10 +7,6 @@ @apply text-gray-90 !important; } -.Container p > code { - @apply border border-gray-40 text-red-70 rounded-md px-1 mx-1 break-words; -} - .Container p:only-child, .Container p:last-child, .Container section:last-child, diff --git a/components/layouts/container.module.css b/components/layouts/container.module.css index fa12c78eb..7f552657d 100644 --- a/components/layouts/container.module.css +++ b/components/layouts/container.module.css @@ -17,6 +17,12 @@ @apply border-b border-b-gray-90 hover:border-red-60 hover:opacity-80; } +/* If link is just for code, don't add border */ +.ArticleContainer a:has(tt:only-child), +.ArticleContainer a:has(code:only-child) { + @apply border-0; +} + :global(.dark) .ArticleContainer p a, :global(.dark) .ArticleContainer ol li a, :global(.dark) .ArticleContainer ul li a { diff --git a/styles/text.scss b/styles/text.scss index 727f904aa..19253c70c 100644 --- a/styles/text.scss +++ b/styles/text.scss @@ -99,7 +99,7 @@ ul + p { @apply mt-8; } -/* Focuss styles */ +/* Focus styles */ a:focus, a:focus-visible, button:focus, @@ -113,8 +113,8 @@ li > code, /* Inline code blocks in docstrings */ tt.docutils.literal { @apply break-words px-1 rounded; - @apply text-green-80 bg-gray-10; - @apply dark:text-green-50 dark:bg-gray-90; + @apply text-green-80 bg-green-80/5; + @apply dark:text-green-50 dark:bg-green-50/10; @apply text-base; } From 951e0714e532f2af4fca757c07d91a1bee814d2f Mon Sep 17 00:00:00 2001 From: Thiago Teixeira Date: Tue, 17 Dec 2024 15:54:39 -0800 Subject: [PATCH 7/7] Got back to old underline style for links with code --- components/layouts/container.module.css | 6 ------ styles/text.scss | 19 +------------------ 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/components/layouts/container.module.css b/components/layouts/container.module.css index 7f552657d..fa12c78eb 100644 --- a/components/layouts/container.module.css +++ b/components/layouts/container.module.css @@ -17,12 +17,6 @@ @apply border-b border-b-gray-90 hover:border-red-60 hover:opacity-80; } -/* If link is just for code, don't add border */ -.ArticleContainer a:has(tt:only-child), -.ArticleContainer a:has(code:only-child) { - @apply border-0; -} - :global(.dark) .ArticleContainer p a, :global(.dark) .ArticleContainer ol li a, :global(.dark) .ArticleContainer ul li a { diff --git a/styles/text.scss b/styles/text.scss index 19253c70c..c4b55b79e 100644 --- a/styles/text.scss +++ b/styles/text.scss @@ -108,8 +108,7 @@ button:focus-visible { } /* Inline code blocks */ -p > code, -li > code, +p code, /* Inline code blocks in docstrings */ tt.docutils.literal { @apply break-words px-1 rounded; @@ -118,22 +117,6 @@ tt.docutils.literal { @apply text-base; } -/* Improve `code` links. Don't use border, use underline instead. */ -a:has(tt:only-child), -a:has(code:only-child) { - @apply border-0; -} - -/* Improve `code` links. Don't use border, use underline instead. */ -a > tt:only-child, -a > code:only-child { - @apply underline; -} - -p a code { - @apply border-none p-0; -} - /* One-line code descriptions in docstrings */ div.code-desc { @apply mb-4 text-gray-90 dark:text-gray-40;