-
-
Notifications
You must be signed in to change notification settings - Fork 479
fix(ui): apply flexbox layout to headings #434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,8 @@ | |
| color: var(--qd-heading-color); | ||
| margin: var(--qd-heading-margin); | ||
| text-transform: none !important; | ||
| display: flex; | ||
| align-items: flex-start; | ||
|
Comment on lines
+14
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚩 display: flex may affect heading numbering layout via ::before pseudo-elements In Was this helpful? React with 👍 or 👎 to provide feedback. |
||
| @include font.global-font-family-with-main-fallback($kind: "heading"); | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| .doctype {paged} | ||
| .pageformat width:{10cm} height:{5cm} margin:{1cm} | ||
|
|
||
| # A multiline title |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import {suite} from "../../quarkdown"; | ||
|
|
||
| const {test, expect} = suite(__dirname); | ||
|
|
||
| test("multiline headings are aligned to the left", async (page) => { | ||
| const heading = page.locator("h1").first(); | ||
| await expect(heading).toHaveCSS("display", "flex"); | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴
display: flexon headings breakstext-align: centerin slides documentsAdding
display: flexto all headings (h1–h6) causestext-aligninheritance to no longer control the positioning of heading content. In slides documents,_alignment.scss:39sets--qd-horizontal-alignment-global: center, which the.quarkdownroot inherits astext-align: center(_alignment.scss:2). Withdisplay: block(the previous default), this centers the inline text within each heading. Withdisplay: flex, text nodes become anonymous flex items whose position is governed byjustify-content(defaulting toflex-start), so heading text will appear left-aligned instead of centered. This regression affects slides using theminimalandhyperlegiblelayout themes (which do not override slides alignment tostart). Thelatexandbeamerthemes are unaffected because they explicitly set--qd-horizontal-alignment-global: startfor.quarkdown-slides.Fix suggestion
Either scope
display: flexto only non-slides documents, or add a compensating rule for slides that setsjustify-content: centeron headings. For example:Was this helpful? React with 👍 or 👎 to provide feedback.