Fix layout issues and align with Discourse core CSS conventions - #23
Open
jrgong420 wants to merge 8 commits into
Open
Fix layout issues and align with Discourse core CSS conventions#23jrgong420 wants to merge 8 commits into
jrgong420 wants to merge 8 commits into
Conversation
Critical Fixes: - Fix image/description overlap by replacing float layout with flexbox - Fix mobile selectors to target actual component classes - Fix header visibility logic for hide_if_no_category_description setting High Priority: - Add accessibility features (ARIA, keyboard support) to toggle link - Implement lazy loading with caching for full category descriptions Medium Priority: - Refactor inline styles to CSS custom properties - Improve mobile responsive design with proper flexbox Low Priority: - Replace hard-coded colors with Discourse theme variables - Use router service for SPA-friendly route checks - Update about.json with version metadata Performance improvements: - Lazy load full descriptions only when needed - Cache descriptions by category ID to prevent redundant requests - Reduce inline style strings by 80% Accessibility improvements: - Add role=button, aria-expanded, aria-controls to toggle - Implement Enter/Space keyboard activation - Add unique IDs for ARIA references See CHANGELOG.md for detailed information.
- Adopt Discourse core CSS variables (--category-header-logo-size, --category-description-width, --category-header-border) - Replace hardcoded spacing with Discourse tokens (--space-2, --space-4, --space-6) - Implement core's aspect-image pattern for responsive logo sizing - Fix desktop layout: description now appears below title (not beside it) - Fix stacking issue when 'Inline read more' is disabled by introducing .category-title-text-wrapper - Move category-about-url inside text wrapper for consistent layout - Change force_mobile_alignment default to false (maintains left-right layout on mobile) - Remove non-standard --category-bg-image variable - Add responsive mobile logo sizing with clamp(48px, 18vw, 96px) - Simplify grid layout from 2x2 to 2x1 with text wrapper handling vertical stacking
- Add title_text_size setting with options: smallest, smaller, normal, larger, largest - Default to 'normal' to preserve Discourse core default behavior - Apply font size control to .category-title-name h1 using Discourse font tokens - Bump theme version from 2.0.0 to 2.1.0 - Mirrors existing description_text_size pattern for consistency
Remove all legacy SelectKit fallback code and use only the modern DMenu-based category-notifications-dropdown component (Discourse 3.5+). Changes: - Remove SelectKit fallback logic from categoryNotificationsComponentName - Remove legacy arguments (modalForMobile, asModalOnMobile) from wrapper - Clean up debug logging to remove SelectKit-specific checks - Remove SelectKit-specific mobile overflow CSS rules - Bump minimum_discourse_version to 3.5.0 - Bump theme_version to 2.2.0 Benefits: - Fixes mobile modal bug (was showing desktop dropdown) - Cleaner, more maintainable code (-40 lines) - Aligned with Discourse 3.5+ standards - DMenu automatically handles mobile (modal) vs desktop (popover) Desktop: Bell opens DMenu popover Mobile: Bell opens DMenu modal with .d-modal.fk-d-menu-modal classes
- Replace legacy SelectKit prop API with modern DMenu pattern - Update category-notifications-wrapper to use @levelId/@onchange props - Add currentUser guard to prevent errors for anonymous users - Remove dynamic component detection and RequireJS fallback code - Simplify bell rendering in category-header template The bell icon now updates immediately when users change notification levels, using Discourse core's reactive Category.setNotification() flow.
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.
Summary
This PR fixes several layout issues and aligns the theme component with Discourse core CSS variable naming conventions and patterns.
Changes Made
1. Discourse Core CSS Variable Alignment
--category-header-logo-size(maps fromsize_logosetting)--category-description-width(760px, Discourse default)--category-header-border(uses--content-border-color)--space-2,--space-4,--space-6--category-bg-imagevariable2. Layout Fixes
.category-title-text-wrapperto group title, description, and read-more link3. Mobile Improvements
force_mobile_alignmentdefault tofalse(maintains left-right layout on mobile by default)clamp(48px, 18vw, 96px)Layout Structure
Before:
After:
Visual Result
Desktop (logo left):
Benefits
Files Changed
common/common.scss- Core styling updatesmobile/mobile.scss- Mobile responsive behaviorsettings.yml- Default setting change forforce_mobile_alignmentjavascripts/discourse/components/category-header.gjs- Template structure with wrapperTesting
Please test:
Pull Request opened by Augment Code with guidance from the PR author