✨ Add an aside component#292
Open
chrisjsewell wants to merge 3 commits into
Open
Conversation
Add an `aside` directive: a CSS-only floated call-out box that the surrounding text wraps around, for pull-outs, margin notes and side comments (complementing, not replacing, admonitions and cards). - `AsideDirective(SdDirective)` with `align` (left/right), `width` (25/33/50%), `margin`, `name` and `class`/`class-title`/`class-body`. - Renders as a semantic HTML `<aside>` element via an html-only post-transform (following the dropdown_main precedent); non-HTML outputs degrade to a plain titled container. - Hand-authored `style/aside.css` (registered in ASSEMBLY): card-like surface reusing the card variables, floats/widths applied only from the `md` breakpoint up so it collapses to a full-width block on small screens, plus a `.sd-clear-both` utility to stop the wrap. - Docs page (rst + myst snippets) and regression fixtures.
Address review feedback on the aside component: - a11y: titled asides now carry `aria-labelledby` pointing at their title, which is given a stable, document-order id (`sd-aside-title-<n>`) when no `:name:` is supplied. Untitled asides stay unlabelled (no invented label text). - RTL: use physical `margin-left`/`margin-right` per float side instead of logical `margin-inline`, so the text-side gap tracks the physical float under `dir="rtl"` (LTR margins are byte-for-byte unchanged). - title: bump the margin/font-weight reset to `.sd-aside > .sd-aside-title` (0,2,0) so it beats a theme's `p.rubric` (0,1,1) instead of relying on the theme happening to bold rubrics. - docs: document the trailing-float escape (a terminal aside needs a following `sd-clear-both` block; themes can clearfix their column), that `:ref:` to an untitled named aside needs explicit link text, and the aria labelling; soften the pydata ToC note; drop the no-op `background-clip`. - tests: lock the aria-labelledby wiring, the untitled bare-`:ref:` warning, and the trailing-clear workaround.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #292 +/- ##
==========================================
+ Coverage 92.63% 92.93% +0.30%
==========================================
Files 13 14 +1
Lines 1371 1430 +59
==========================================
+ Hits 1270 1329 +59
Misses 101 101
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an
asidedirective (closes #97): a floated call-out box that body text wraps around, rendered as a semantic<aside>element in HTML — CSS-only, no JavaScript.Behaviour
:width:25/33/50% from themdbreakpoint up; below it, a full-width block — mobile never wraps.<aside>(complementary landmark) via an HTML-only post-transform on thedropdown_mainpattern; LaTeX/text/man keep a plain titled container (built and verified — no crash, sensible degradation).aria-labelledbywired to the title, minting a deterministic title id when:name:isn't given; untitled asides stay unlabelled (documented)..sd-aside > .sd-aside-titlespecificity so themep.rubricrules can't reintroduce stray margins (review-measured 30px gap on alabaster, now 0).sd-clear-bothdiv (locked by test), and cross-references to untitled named asides need explicit link text.Verification
:ref:resolves with the anchor landing on the idstyle/aside.cssregistered inASSEMBLY, artifact regenerated through the generator pipeline-nW