8000 fix(flex): respect DesktopOnly and MobileOnly components by saberzero1 · Pull Request #1971 · jackyzha0/quartz · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Open
wants to merge 2 commits into
base: v4
Choose a base branch
from

Conversation

saberzero1
Copy link
Collaborator

Closes #1969

Cause

The inline style in the Flex component was overriding any other display CSS value set to it. In addition, desktop-only and mobile-only were only applied to components inside the Flex component.

This change adds a flex-component CSS class to the Flex component, as well as any desktop-only or mobile-only class, if applicable. The CSS rules for desktop-only and mobile-only have been extended to set display: flex instead of display: initial when used with desktop-only or mobile-only.

Copy link
github-actions bot commented May 10, 2025
built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
quartz ✅ Ready (View Log) Visit Preview f39e134

Copy link
Contributor
@Copilot Copilot AI left a 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; }

quartz/components/Flex.tsx Outdated Show resolved Hide resolved
@saberzero1 saberzero1 requested a review from Copilot May 10, 2025 15:43
Copy link
Contributor
@Copilot Copilot AI left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Component.DesktopOnly(Component.Flex()) showing up on Mobile and vice versa
1 participant
0