-
Notifications
You must be signed in to change notification settings - Fork 9
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
Adding an internal theme #253
Conversation
Update: I'm reworking this PR to:
|
…t by expanding text-theme-red and renaming to text-theme-color. Moving all internal theme scss to a separate file
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.
@Scotchester I've updated this PR to address the following:
- group all internal styles in a single scss file
usenot needed anymore, see write-up below@apply
inBaseLink
andBlockAccordion
for both the default and internal theme colors- rework the docs per code review
In doing this work, I discovered I also needed to rework the .text-theme-red
classes. I decided to expand on it by adding .ThemeInternal
styles for it as well. The name also no longer made sense, so I renamed those classes to .text-theme-color
and .text-theme-color-hover
. I only deprecated the old class names, so this isn't a breaking change. This also greatly simplifies the scss overrides needed in most of our components. We only need them for BaseButton
now. It also negates the need for having a .BaseLink
class applied to every link. The documentation has also been updated regarding the "Adaptive Text Colors."
I also updated BlockRelatedLinks
to have an internal theme (an oversight from the previous work). Thanks to the updated text classes, this was just a matter of changing the inline class from text-jpl-red
to text-theme-color
.
Migration notes
Internal themes have been added to Explorer 1. To use them, add .ThemeInternal
as a body class to your project. If you are compiling your own scss assets, be sure to import the new /src/scss/themes/_internal.scss
file.
.text-theme-red
and .text-theme-red-hover
are now deprecated and have been superseded by .text-theme-color
and .text-theme-color-hover
. While the old class names will still work, they will be removed in the next major release. To prevent any unexpected style changes, it's recommended to update your class names now.
Update the templates of the following components to use the new .text-theme-color
and .text-theme-color-hover
classes:
BaseLink
BlockRelatedLink
BlockAccordionItem
MixinAnimationCaret
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.
Looking very good! Just a few final questions.
storybook/stories/components/BlockImageCarousel/BlockImageCarousel.stories.js
Show resolved
Hide resolved
Thanks for the review @Scotchester! I've updated the filenames and responded to your questions. |
Checklist
Description
This is a start to "combining the storybooks." It really only covers adding the internal styles. Some implementation notes:
ThemeInternal
to their site..BaseLink
class in place on our BaseLink component template, so users that want to start using the internal theme will need to update a lot of their component templates. On the other hand, we may not have that many users, so perhaps not a big worry._BlockAccordion.scss
). It will also make it more difficult to create a dedicatedinternal.min.css
file as discussed. I think I'm going to change the approach and move all internal theme styles to a single SCSS file, but I'm definitely interested in other devs thoughts on this before I make that change.HeaderInternal
andHeaderExternal
. Then in storybook we can structure the documentation like so:Instructions to test
npm run storybook
Tested in the following environments/browsers:
Operating System
Browser