Integrate the typography plugin with dark mode

References #27
This commit is contained in:
Oliver Davies 2020-10-29 01:41:32 +00:00
parent c0355a4e89
commit a888430ef3
7 changed files with 22 additions and 8 deletions

View file

@ -15,7 +15,7 @@ img {
} }
a { a {
@apply text-blue-700 no-underline hover:underline @apply text-blue-500 no-underline hover:underline
} }
blockquote { blockquote {

View file

@ -55,6 +55,19 @@ module.exports = {
'pre code::before': false, 'pre code::before': false,
'pre code::after': false 'pre code::after': false
} }
},
dark: {
css: {
color: theme('colors.gray.200'),
h2: {
color: theme('colors.white')
},
strong: {
color: theme('colors.gray.200')
}
}
} }
}), }),
extend: { extend: {
@ -103,6 +116,7 @@ module.exports = {
borderStyle: [...variants.borderStyle, 'hover', 'focus'], borderStyle: [...variants.borderStyle, 'hover', 'focus'],
borderWidth: [...variants.borderWidth, 'hover', 'focus'], borderWidth: [...variants.borderWidth, 'hover', 'focus'],
margin: [...variants.margin, 'first', 'last', 'odd', 'even'], margin: [...variants.margin, 'first', 'last', 'odd', 'even'],
typography: ['responsive', 'dark']
}, },
experimental: { experimental: {
applyComplexClasses: true, applyComplexClasses: true,

View file

@ -44,12 +44,12 @@
{% if multiple %} {% if multiple %}
<div{{ attributes }}> <div{{ attributes }}>
{% for item in items %} {% for item in items %}
<div{{ item.attributes.addClass('prose max-w-none') }}>{{ item.content }}</div> <div{{ item.attributes.addClass('prose dark:prose-dark max-w-none') }}>{{ item.content }}</div>
{% endfor %} {% endfor %}
</div> </div>
{% else %} {% else %}
{% for item in items %} {% for item in items %}
<div{{ attributes.addClass('prose max-w-none') }}>{{ item.content }}</div> <div{{ attributes.addClass('prose dark:prose-dark max-w-none') }}>{{ item.content }}</div>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% else %} {% else %}
@ -59,7 +59,7 @@
<div> <div>
{% endif %} {% endif %}
{% for item in items %} {% for item in items %}
<div{{ item.attributes.addClass('prose max-w-none') }}>{{ item.content }}</div> <div{{ item.attributes.addClass('prose dark:prose-dark max-w-none') }}>{{ item.content }}</div>
{% endfor %} {% endfor %}
{% if multiple %} {% if multiple %}
</div> </div>

View file

@ -42,7 +42,7 @@
] ]
%} %}
<div{{ attributes.addClass('prose max-w-none') }}> <div{{ attributes.addClass('prose dark:prose-dark max-w-none') }}>
<h2{{ title_attributes.addClass(title_classes) }}> <h2{{ title_attributes.addClass(title_classes) }}>
{{ label }} {{ label }}
</h2> </h2>

View file

@ -90,7 +90,7 @@
</footer> </footer>
{% endif %} {% endif %}
<div{{ content_attributes.addClass(['space-y-6', page ? 'prose max-w-none']) }}> <div{{ content_attributes.addClass(['space-y-6', page ? 'prose dark:prose-dark max-w-none']) }}>
{{ content }} {{ content }}
</div> </div>

View file

@ -41,7 +41,7 @@
{{ title_suffix }} {{ title_suffix }}
{% if header %} {% if header %}
<header class="prose lg:prose-lg xl:prose-xl"> <header class="prose dark:prose-dark lg:prose-lg xl:prose-xl">
{{ header }} {{ header }}
</header> </header>
{% endif %} {% endif %}

View file

@ -41,7 +41,7 @@
{{ title_suffix }} {{ title_suffix }}
{% if header %} {% if header %}
<header class="prose lg:prose-lg xl:prose-xl"> <header class="prose dark:prose-dark lg:prose-lg xl:prose-xl">
{{ header }} {{ header }}
</header> </header>
{% endif %} {% endif %}