Conversation
🏷️ Automatic Labeling SummaryThis PR has been automatically labeled based on the files changed and PR metadata. Applied Labels: No labels applied yet Label Categories
For more information, see |
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
…idth, add dark/light theme support - Fix stakeholder SWOT grid layout: change from auto-fit minmax(300px) to single-column (2-col on 1024px+) so nested 2×2 grids don't overlap - Constrain article container to max-width: 1200px for readability - Add paragraph max-width: 75ch for optimal line length - Add image responsive sizing (max-width: 100%, height: auto) - Add dark theme SWOT color overrides for better contrast - Add missing .article-lede, .interpellation-entry, .motion-entry styles - Add overflow/word-wrap on SWOT quadrants to prevent text overflow - Add RTL support for new entry card styles Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/e330f260-5ac3-4443-a63c-6a231b2daeae Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
🔍 Lighthouse Performance Audit
📥 Download full Lighthouse report Budget Compliance: Performance budgets enforced via |
There was a problem hiding this comment.
Pull request overview
This PR updates the site’s news-article styling to improve readability and fix SWOT/stakeholder SWOT layout issues, including better dark/light theme presentation for these components.
Changes:
- Adjusted SWOT/stakeholder SWOT grid rules to prevent card/quadrant overlap and text bleed; added theme-specific overrides.
- Constrained
.news-articlecontainer width and added new article content rules (paragraph width, image/figure handling). - Added styling for
.article-lede,.interpellation-entry, and.motion-entryblocks used in generated article HTML.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| styles/components/swot.css | Fixes stakeholder SWOT grid layout and adds overflow/wrapping/theme overrides for SWOT components. |
| styles.css | Constrains article container width, improves prose/images rendering, and adds missing card styles for article ledes and document entry blocks. |
| border: 2px solid var(--border-color, #ddd); | ||
| box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); | ||
| transition: box-shadow 0.2s ease, transform 0.2s ease; | ||
| overflow: hidden; |
There was a problem hiding this comment.
overflow: hidden on .swot-quadrant can clip focus outlines/indicators for interactive content inside the quadrant (e.g., the <details class="swot-justification"><summary>…</summary>…</details> blocks used in news articles). Consider avoiding overflow: hidden here and instead rely on wrapping (overflow-wrap, word-break) or apply overflow handling to a more specific inner element so keyboard focus remains fully visible.
| overflow: hidden; |
| @media (max-width: 500px) { | ||
| .news-article .stakeholder-swot-card .swot-grid { | ||
| grid-template-columns: 1fr; | ||
| } | ||
| } |
There was a problem hiding this comment.
The nested .swot-grid inside stakeholder cards switches to 1 column only at max-width: 500px, which introduces a one-off breakpoint that doesn’t match the rest of the site’s responsive breakpoints (e.g. 480px/768px are used widely in styles.css). Align this breakpoint with the existing set to keep responsive behavior predictable and easier to maintain.
| .news-article .article-content p { | ||
| margin: 0 0 1.35rem 0; | ||
| line-height: 1.8; | ||
| max-width: 75ch; | ||
| } |
There was a problem hiding this comment.
The max-width: 75ch paragraph constraint only applies to p inside .article-content. Several article templates (e.g. weekly-review pages) place prose directly under .news-article sections without an .article-content wrapper, so this readability fix won’t apply consistently. Consider broadening the selector (e.g. include .news-article .article-section p / similar) while excluding metadata/nav areas as needed.
| .news-article .interpellation-entry h4, | ||
| .news-article .motion-entry h4 { | ||
| margin: 0 0 0.5rem 0; | ||
| font-size: 1rem; | ||
| color: var(--header-color, #006633); | ||
| } |
There was a problem hiding this comment.
.motion-entry blocks in existing news pages use an h3 heading (not h4), but the new card heading styles target only .motion-entry h4. As a result, motion titles won’t get the intended styling. Update the selector to cover the actual heading level used (or style both h3 and h4 for robustness).
Stakeholder SWOT cards overlap severely because the grid uses
auto-fit minmax(300px, 1fr)which crams 6 cards side-by-side, each containing a nested 2×2 SWOT quadrant grid that has no room. Article prose sprawls to full viewport width with no readable constraint.SWOT grid layout fix (
styles/components/swot.css)stakeholder-swot-gridusedrepeat(auto-fit, minmax(300px, 1fr))— replaced with single-column default, 2-col at≥1024pxoverflow: hidden; word-wrap: break-word; min-width: 0on quadrants/cards to prevent text bleedArticle readability (
styles.css).news-articletomax-width: 1200px(was100%in two competing declarations)max-width: 75chon article paragraphs for optimal line lengthmax-width: 100%; height: auto; display: blockDark/light theme support
.article-sources,.article-lede, entry cardsMissing styles
.article-lede,.interpellation-entry,.motion-entrycard styles with border-left accent, background, padding, and RTL support — these classes were used in article HTML but had no CSS