Skip to content

Commit

Permalink
💄 Workaround @tailwindcss/typography hover issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jpanther committed Jan 8, 2022
1 parent e8b3102 commit ac77abe
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 19 deletions.
71 changes: 59 additions & 12 deletions assets/css/compiled/main.css
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 {
Expand All @@ -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;
}

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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"] *)) {
Expand Down Expand Up @@ -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);
}

Expand Down
18 changes: 11 additions & 7 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
},
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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": {
Expand Down

0 comments on commit ac77abe

Please sign in to comment.