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

Merged
merged 18 commits into from
Jun 2, 2025

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.

8000 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 c509f14

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; }

@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

Copy link
Collaborator
@aarnphm aarnphm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aarnphm
Copy link
Collaborator
aarnphm commented May 24, 2025

let's also add a notes into Flex component docs here.

@saberzero1 saberzero1 self-assigned this May 26, 2025
saberzero1 and others added 16 commits June 2, 2025 11:54
This is in line with Obsidian's behavior.
…ferently (#1992)

* feat: add option to disable broken wikilinks

* fix(style): update hover color for broken links and introduce new class

* feat: add "disableBrokenWikilinks" option to ObsidianFlavoredMarkdown
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…y with 9 updates (#1996)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…(for #1337) (#2000)

* docs: added note to not forget to add https:// to the plausible-host (for #1337)

* Update docs/configuration.md

---------

Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>
@saberzero1 saberzero1 merged commit b48aa91 into v4 Jun 2, 2025
6 checks passed
@saberzero1 saberzero1 deleted the flex-component-display branch June 2, 2025 16:37
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
8 participants
0