Skip to content

Ensure dark colors are always used in tutorial hero #760

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

Conversation

mportiz08
Copy link
Contributor

@mportiz08 mportiz08 commented Nov 30, 2023

Bug/issue #, if applicable: 118359891

Summary

Since this component is meant to always be rendered with a dark color scheme regardless of the user chosen setting, there may be some elements (like asides) that may look broken in light mode since they are trying to use light color scheme colors on the dark background.

Example

Before
screenshot showing the issue on the main branch

After
screenshot showing the resolved issue on this branch

Testing

Steps:

  1. Create or update a tutorial with a warning aside in the tutorial intro section
  2. Using this branch, open that tutorial page and verify that the warning aside uses the dark colors, even when you choose the "Light" color scheme option
  3. Ensure there are no regressions with other colors in this element

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests (CSS only change)
  • Ran npm test, and it succeeded
  • Updated documentation if necessary

Since this component is meant to always be rendered with a dark color
scheme regardless of the user chosen setting, there may be some elements
(like asides) that may look broken in light mode since they are trying
to use light color scheme colors on the dark background.
Copy link
Contributor

@dobromir-hristov dobromir-hristov left a comment

Choose a reason for hiding this comment

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

A bit barbaric 🤣 but we dont have the notion of "themed" components, where we can toggle the light or dark theme on demand, so this will suffice.

@mportiz08
Copy link
Contributor Author

A bit barbaric 🤣 but we dont have the notion of "themed" components, where we can toggle the light or dark theme on demand, so this will suffice.

Yeah, I kind of hate it lol, but I don't know of a better alternative without explicitly overriding specific colors...which would mean we would end up missing others at some point. Luckily there doesn't seem to be any noticeable performance impact with just redefining all the vars in this way 😅

@mportiz08
Copy link
Contributor Author

@swift-ci test

@mportiz08 mportiz08 merged commit bd73a32 into swiftlang:main Dec 1, 2023
@mportiz08 mportiz08 deleted the force-dark-color-scheme-in-tutorial-hero branch December 1, 2023 22:25
mportiz08 added a commit to mportiz08/swift-docc-render that referenced this pull request Dec 1, 2023
Since this component is meant to always be rendered with a dark color
scheme regardless of the user chosen setting, there may be some elements
(like asides) that may look broken in light mode since they are trying
to use light color scheme colors on the dark background.

Resolves: rdar://118359891
mportiz08 added a commit that referenced this pull request Dec 5, 2023
Since this component is meant to always be rendered with a dark color
scheme regardless of the user chosen setting, there may be some elements
(like asides) that may look broken in light mode since they are trying
to use light color scheme colors on the dark background.

Resolves: rdar://118359891
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.

2 participants