Skip to content

feat(playground): pass the variables theming file to StackBlitz #2602

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 2 commits into from
Oct 11, 2022

Conversation

brandyscarney
Copy link
Member

@brandyscarney brandyscarney commented Oct 7, 2022

This PR does the following:

  • Adds the variables.css file to the angular, javascript (html), react and vue directories.
    • The source code for this file was copied from the starters
  • Adds the missing import of display.css to the react, javascript and angular css imports.
  • Passes the variables.css file to StackBlitz in a folder called theme
    • This was done to match the directory structure of the starters

Issue found:
When viewing the website in light mode, then opening a StackBlitz (any language) while the system is set to prefer dark mode, it will display the StackBlitz example in dark mode. This is working as intended based on the content in the variable.css file, but it may be unexpected for users since the website is not automatically displayed in dark mode until you toggle the dark theme. Should we change this so it checks what mode the user is in on the website?

Chip is a pretty good example of this: https://ionic-docs-git-fw-1666-ionic1.vercel.app/docs/api/chip

@vercel
Copy link

vercel bot commented Oct 7, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
ionic-docs ✅ Ready (Inspect) Visit Preview Oct 7, 2022 at 7:22PM (UTC)

@brandyscarney brandyscarney requested a review from a team October 7, 2022 19:24
Copy link
Contributor

@averyjohnston averyjohnston left a comment

Choose a reason for hiding this comment

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

I verified this is working with the accordion Advanced Expansion Styles playground: https://ionic-docs-git-fw-1666-ionic1.vercel.app/docs/api/accordion#advanced-expansion-styles On main, when opening in Stackblitz, you can't see the primary color when the accordion is opened, but it works on this branch. 👍

As for the Stackblitz checking whether the site is set to light or dark and opening in that instead, that sounds like a similar issue to how Stackblitz always uses the device for ios vs. md mode, rather than what you had the playground set to. I'm leaning keep it as-is for now, and then fix both behaviors at once later so there's consistency with whether Stackblitz mirrors the site or the device.

@brandyscarney brandyscarney merged commit 7ee8a32 into main Oct 11, 2022
@brandyscarney brandyscarney deleted the FW-1666 branch October 11, 2022 18:48
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.

3 participants