From ac77abe91fecc9882b34494389a44bc82db790af Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Sun, 9 Jan 2022 10:42:08 +1100 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20Workaround=20@tailwindcss/typogr?= =?UTF-8?q?aphy=20hover=20issue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ref: https://github.com/tailwindlabs/tailwindcss-typography/issues/231 --- assets/css/compiled/main.css | 71 ++++++++++++++++++++++++++++++------ tailwind.config.js | 18 +++++---- 2 files changed, 70 insertions(+), 19 deletions(-) diff --git a/assets/css/compiled/main.css b/assets/css/compiled/main.css index bfc50052..9f20c29c 100644 --- a/assets/css/compiled/main.css +++ b/assets/css/compiled/main.css @@ -1,6 +1,6 @@ /*! Congo v1.6.2 | MIT License | https://github.com/jpanther/congo */ -/*! tailwindcss v3.0.7 | MIT License | https://tailwindcss.com */ +/*! tailwindcss v3.0.12 | MIT License | https://tailwindcss.com */ /* 1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) @@ -77,7 +77,7 @@ hr { Add the correct text decoration in Chrome, Edge, and Safari. */ -abbr[title] { +abbr:where([title]) { -webkit-text-decoration: underline dotted; text-decoration: underline dotted; } @@ -424,7 +424,48 @@ Ensure the default browser behavior of the `hidden` attribute. } *, ::before, ::after { - border-color: currentColor; + --tw-translate-x: 0; + --tw-translate-y: 0; + --tw-rotate: 0; + --tw-skew-x: 0; + --tw-skew-y: 0; + --tw-scale-x: 1; + --tw-scale-y: 1; + --tw-pan-x: ; + --tw-pan-y: ; + --tw-pinch-zoom: ; + --tw-scroll-snap-strictness: proximity; + --tw-ordinal: ; + --tw-slashed-zero: ; + --tw-numeric-figure: ; + --tw-numeric-spacing: ; + --tw-numeric-fraction: ; + --tw-ring-inset: ; + --tw-ring-offset-width: 0px; + --tw-ring-offset-color: #fff; + --tw-ring-color: rgb(59 130 246 / 0.5); + --tw-ring-offset-shadow: 0 0 #0000; + --tw-ring-shadow: 0 0 #0000; + --tw-shadow: 0 0 #0000; + --tw-shadow-colored: 0 0 #0000; + --tw-blur: ; + --tw-brightness: ; + --tw-contrast: ; + --tw-grayscale: ; + --tw-hue-rotate: ; + --tw-invert: ; + --tw-saturate: ; + --tw-sepia: ; + --tw-drop-shadow: ; + --tw-backdrop-blur: ; + --tw-backdrop-brightness: ; + --tw-backdrop-contrast: ; + --tw-backdrop-grayscale: ; + --tw-backdrop-hue-rotate: ; + --tw-backdrop-invert: ; + --tw-backdrop-opacity: ; + --tw-backdrop-saturate: ; + --tw-backdrop-sepia: ; } .prose { @@ -449,9 +490,9 @@ Ensure the default browser behavior of the `hidden` attribute. } :where(.prose a:hover):not(:where([class~="not-prose"] *)) { - color: var(--color-neutral); - text-decoration: none; - background-color: var(--color-primary-600); + color: var(--color-neutral) !important; + text-decoration: none !important; + background-color: var(--color-primary-600) !important; border-radius: 0.09rem; } @@ -675,12 +716,11 @@ Ensure the default browser behavior of the `hidden` attribute. .prose :where(thead):not(:where([class~="not-prose"] *)) { border-bottom-width: 1px; - border-bottom-color: var(--color-neutral-500); - color: var(--color-neutral-800); + border-bottom-color: var(--tw-prose-th-borders); } .prose :where(thead th):not(:where([class~="not-prose"] *)) { - color: var(--tw-prose-headings); + color: var(--color-neutral-800); font-weight: 600; vertical-align: bottom; padding-right: 0.5714286em; @@ -857,6 +897,10 @@ Ensure the default browser behavior of the `hidden` attribute. background-color: var(--color-neutral-500); } +.prose :where(thead tr):not(:where([class~="not-prose"] *)) { + border-bottom-color: var(--color-neutral-500); +} + .prose :where(kbd):not(:where([class~="not-prose"] *)) { background-color: var(--color-neutral-200); padding: 0.1rem 0.4rem; @@ -2330,8 +2374,8 @@ body a, body button { } :where(.dark .dark\:prose-light a:hover):not(:where([class~="not-prose"] *)) { - color: var(--color-neutral); - text-decoration: none; + color: var(--color-neutral) !important; + text-decoration: none !important; } .dark .dark\:prose-light :where(strong):not(:where([class~="not-prose"] *)) { @@ -2392,8 +2436,11 @@ body a, body button { color: var(--color-neutral-200); } -.dark .dark\:prose-light :where(thead):not(:where([class~="not-prose"] *)) { +.dark .dark\:prose-light :where(thead th):not(:where([class~="not-prose"] *)) { color: var(--color-neutral); +} + +.dark .dark\:prose-light :where(thead tr):not(:where([class~="not-prose"] *)) { border-bottom-color: var(--color-neutral-500); } diff --git a/tailwind.config.js b/tailwind.config.js index 207d0131..9c2d357f 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -61,9 +61,9 @@ module.exports = { textDecorationColor: theme("colors.primary.300"), fontWeight: "500", "&:hover": { - color: theme("colors.neutral.DEFAULT"), - textDecoration: "none", - backgroundColor: theme("colors.primary.600"), + color: `${theme("colors.neutral.DEFAULT")} !important`, + textDecoration: "none !important", + backgroundColor: `${theme("colors.primary.600")} !important`, borderRadius: "0.09rem", }, }, @@ -115,8 +115,10 @@ module.exports = { "pre code": { color: theme("colors.neutral.700"), }, - thead: { + "thead th": { color: theme("colors.neutral.800"), + }, + "thead tr": { borderBottomColor: theme("colors.neutral.500"), }, "tbody tr": { @@ -145,8 +147,8 @@ module.exports = { color: theme("colors.primary.400"), textDecorationColor: theme("colors.neutral.500"), "&:hover": { - color: theme("colors.neutral.DEFAULT"), - textDecoration: "none", + color: `${theme("colors.neutral.DEFAULT")} !important`, + textDecoration: "none !important", }, }, strong: { @@ -193,8 +195,10 @@ module.exports = { "pre code": { color: theme("colors.neutral.200"), }, - thead: { + "thead th": { color: theme("colors.neutral.DEFAULT"), + }, + "thead tr": { borderBottomColor: theme("colors.neutral.500"), }, "tbody tr": {