[Refactor] Inherit font family body on most standard components (#1994)

This commit is contained in:
Carlos Fernandez 2026-06-13 05:43:59 -04:00 committed by GitHub
parent 9f26c53af5
commit a486ed75a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 30 additions and 40 deletions

View file

@ -1,25 +1,21 @@
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Cinzel+Decorative:wght@700&family=Montserrat:wght@400;600&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Cinzel+Decorative:wght@700&family=Montserrat:wght@400;600&display=swap');
@import './mixin.less'; @import './mixin.less';
:root { :root {
--dh-font-title: 'Cinzel Decorative'; --dh-font-title: 'Cinzel Decorative';
--dh-font-subtitle: 'Cinzel'; --dh-font-subtitle: 'Cinzel';
--dh-font-body: 'Montserrat'; --dh-font-body: 'Montserrat';
/* Include missing font sizes */ /* Include missing font sizes */
--font-size-8: 0.5rem; --font-size-8: 0.5rem;
--font-size-9: 0.5625rem; --font-size-9: 0.5625rem;
--font-size-22: 1.375rem; --font-size-22: 1.375rem;
} }
@font-title: ~"var(--dh-font-title, 'Cinzel Decorative'), serif"; @font-title: ~"var(--dh-font-title, 'Cinzel Decorative'), serif";
@font-subtitle: ~"var(--dh-font-subtitle, 'Cinzel'), serif"; @font-subtitle: ~"var(--dh-font-subtitle, 'Cinzel'), serif";
@font-body: ~"var(--dh-font-body, 'Montserrat'), sans-serif"; @font-body: ~"var(--dh-font-body, 'Montserrat'), sans-serif";
.dh-style { .dh-style {
.dh-typography(); .dh-typography();
} }
.dh-style fieldset {
.dh-typography();
}

View file

@ -49,16 +49,15 @@
* Apply default typography styles. * Apply default typography styles.
*/ */
.dh-typography() { .dh-typography() {
--font-body: @font-body;
font-family: @font-body;
h1 { h1 {
--dh-input-color-text: @color-text-emphatic; --dh-input-color-text: @color-text-emphatic;
font-family: @font-title; font-family: @font-title;
margin: 0; margin: 0;
border: none; border: none;
font-weight: normal; font-weight: normal;
input[type='text'],
.input[contenteditable] {
font-family: @font-title;
}
} }
h2, h2,
@ -86,22 +85,17 @@
font-weight: normal; font-weight: normal;
} }
p, // todo: determine if we can remove these or replace with font-family: inherit
span,
textarea,
label,
select,
multi-select .tags .tag, multi-select .tags .tag,
table, table,
fieldset legend, .tagify__dropdown {
input[type='text'],
input[type='number'],
input[type='search'],
.tagify__dropdown,
li {
font-family: @font-body; font-family: @font-body;
} }
textarea {
font-family: inherit;
}
button span { button span {
font-weight: bold; font-weight: bold;
} }