-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix(flex): respect DesktopOnly and MobileOnly components #1971
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: v4
Are you sure you want to change the base?
Conversation
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
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.
Pull Request Overview
This PR fixes the Flex component’s CSS issues by ensuring that DesktopOnly and MobileOnly elements receive the correct display properties regardless of their containment inside the Flex component.
- Added a reusable .flex-component CSS class in base.scss with support for desktop-only and mobile-only variants.
- Modified the Flex component in Flex.tsx to remove the inline display property and use the new CSS class instead.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
quartz/styles/base.scss | Added .flex-component styling and nested rules for desktop/mobile-only responsiveness. |
quartz/components/Flex.tsx | Removed inline display declaration and added class aggregation for flex-component styling. |
Comments suppressed due to low confidence (1)
quartz/styles/base.scss:131
- [nitpick] Consider adding a brief comment explaining the reasoning behind the nested &.flex-component rules to improve maintainability and clarity regarding the CSS specificity, especially under media queries.
&.flex-component { 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.
Pull Request Overview
This PR fixes the Flex component so that the CSS rules for desktop-only and mobile-only components work correctly by adding a "flex-component" class and updating the related styles.
- Updated base.scss to add a new "flex-component" class and adjust media query rules.
- Modified Flex.tsx to apply the "flex-component" class to the Flex container.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
quartz/styles/base.scss | Added .flex-component rules and updated desktop-only/mobile-only styles with media query adjustments |
quartz/components/Flex.tsx | Updated Flex component to use classNames for proper CSS class application |
Closes #1969
Cause
The inline
style
in theFlex
component was overriding any otherdisplay
CSS value set to it. In addition,desktop-only
andmobile-only
were only applied to components inside theFlex
component.This change adds a
flex-component
CSS class to theFlex
component, as well as anydesktop-only
ormobile-only
class, if applicable. The CSS rules fordesktop-only
andmobile-only
have been extended to setdisplay: flex
instead ofdisplay: initial
when used withdesktop-only
ormobile-only
.