docs-infra: theming and dark mode #41129
Conversation
e42dbd6
to
8cd2a5c
You can preview dd399cf at https://pr41129-dd399cf.ngbuilds.io/. |
3ceb5ef
to
77ab271
You can preview 77ab271 at https://pr41129-77ab271.ngbuilds.io/. |
Implemented a prototype dark mode to iterate from. Unrelated but is the ";;" at the bottom of the page on https://angular.io/ supposed to be there? Noticed it while working on this. |
77ab271
to
cee8e1f
You can preview cee8e1f at https://pr41129-cee8e1f.ngbuilds.io/. |
b8a3a7d
to
4931453
You can preview 4931453 at https://pr41129-4931453.ngbuilds.io/. |
4931453
to
f35ca19
You can preview f35ca19 at https://pr41129-f35ca19.ngbuilds.io/. |
f35ca19
to
85b7010
You can preview 85b7010 at https://pr41129-85b7010.ngbuilds.io/. |
85b7010
to
93c32fc
You can preview 93c32fc at https://pr41129-93c32fc.ngbuilds.io/. |
93c32fc
to
083086a
You can preview 083086a at https://pr41129-083086a.ngbuilds.io/. |
Encountered a weird bug while working on this. When I install aio with the install prompt in the url bar, the installed aio opens as expected but when I click the toggle for dark mode all the content on the screen becomes invisible. On mac os chrome 89.0.4389.90. Confirmed that this does not happen on windows.
Can anyone confirm being able to reproduce this on their end? |
083086a
to
7927057
You can preview 7927057 at https://pr41129-7927057.ngbuilds.io/. |
@gkalpak any final comments on this? |
Amazing work, @AleksanderBodurri (and everyone chiming in/reviewing) I have left a few comments, but I would be fine with dealing with (most of) them in a follow-up PR (since this has already gotten quite big). Also, I noticed a couple of issues on smaller screens (due to increasing the items we try to cram in the limited horizontal space of the toolbar. At around 480px width, the search-bar overlaps with the Angular logo: On mobile phones (e.g. at 360px width), some of the social icons overflow out of the screen (with no indication they exist or a way to get to them). Maybe we could consider moving them into the sidenav on smaller screens? |
aio/src/styles/1-layouts/marketing-layout/_marketing-layout-theme.scss
Outdated
Show resolved
Hide resolved
aio/src/styles/1-layouts/marketing-layout/_marketing-layout-theme.scss
Outdated
Show resolved
Hide resolved
Previously, we had the same logic in a couple of places to safely access the `Window`'s `local-/sessionStorage` and provide a no-op fallback if necessary. In the near future, we will need to same logic in more places (for example, the light/dark theme toggle in angular#41129 and the cookies popup for angular#42209). This commit reduces code duplication by encapsulating the logic in a `StorageService`. This also makes it easier to mock the storage in tests without having to mess with the actual `Window` object.
66195fa
to
9d79153
You can preview 9d79153 at https://pr41129-9d79153.ngbuilds.io/. |
9d79153
to
93bf826
You can preview 93bf826 at https://pr41129-93bf826.ngbuilds.io/. |
93bf826
to
9a73356
@gkalpak I think I've addressed most of your comments. Appreciate the review |
You can preview 9a73356 at https://pr41129-9a73356.ngbuilds.io/. |
9a73356
to
c800bca
You can preview c800bca at https://pr41129-c800bca.ngbuilds.io/. |
c800bca
to
c918995
You can preview c918995 at https://pr41129-c918995.ngbuilds.io/. |
c918995
to
4339e5c
brings in theming tools from material io into angular io in preparation of implementing darkmode
scss files were forwarded from files that were named without convention, changes these file names to follow conventions
…ad of the global imports move away from using global constants in scss files because @import will be deprecated soon
…f global imports move away from global mixins because @import is going to be deprecated
creates theming files for the aio typography styles; done as part of the effort to make aio themeable
creates theming files for the module styles in aio; done as part of the effor to make aio themeable
defines styles for a first iteration of an aio darkmode
4339e5c
to
7ca90ae
You can preview 7ca90ae at https://pr41129-7ca90ae.ngbuilds.io/. |
Meant to continue the conversation from #40257.
This
draftPR is a major refactor of the styles in https://angular.io/ in an effort to make aio themeable (primarily for a long awaited dark mode) and move towards using the sass module system.The implementation is heavily inspired by the awesome folks who've worked on material.angular.io.
Previously styles were organized like this:
This PR changes this structure to:
Essentially splitting styling related to theming into separate files. Within each theme file is a scss mixin that takes in a material theme configuration and generates the appropriate styling for that theme and component.
Theme configurations are defined in:
src/styles/custom-themes
Tooling that has been ported over from material.angular.io allows theme chunks to be lazy loaded.
The advantage of this approach:
@import
s that are no longer recommended by the sass teamdisadvantages:
I'm opening this as a draft to request further technical review, and to start a conversation around what we want a potential dark mode to look like. This draft provides the tooling to make aio themeable,
but does not provide an actual dark mode implementation. I didn't want to attempt an implementation without first getting direction from the design team.EDIT: pushed a prototype dark mode implementation to iterate from.
EDIT: PR is ready to review🔍
PR Type
What kind of change does this PR introduce?
Does this PR introduce a breaking change?