Comments (6)
Could you maybe dig into it for the rest of us? This would be very much appreciated!
Most definitely. I'll open a merge request when I've got it figured out.
from angular-material-css-vars.
Thanks for opening this up. Good question. Don't have the answer unfortunately. There might be definitely some minor (as far as I can see very very few) quirks left, one needs to address manually. Have a look here:
Could you maybe dig into it for the rest of us? This would be very much appreciated!
from angular-material-css-vars.
That's awesome! Thank you!
from angular-material-css-vars.
We are using
$dark-disabled-text: rgba(black, 0.38);
When in light mode we should use:
$light-disabled-text: rgba(white, 0.5);
Looks like we set the foreground once in main.scss
We only have a single foreground palette for both dark and light theme.
angular-material-css-vars/projects/material-css-vars/src/lib/_variables.scss
Lines 273 to 289 in ac07254
We decided to use dark variables for all the foreground so the disabled color works in dark mode but not in light mode. We need to switch between two colored pallets like in angular material.
// Foreground palette for light themes.
$mat-light-theme-foreground: (
base: black,
divider: $dark-dividers,
dividers: $dark-dividers,
disabled: $dark-disabled-text,
disabled-button: rgba(black, 0.26),
disabled-text: $dark-disabled-text,
elevation: black,
hint-text: $dark-disabled-text,
secondary-text: $dark-secondary-text,
icon: rgba(black, 0.54),
icons: rgba(black, 0.54),
text: rgba(black, 0.87),
slider-min: rgba(black, 0.87),
slider-off: rgba(black, 0.26),
slider-off-active: rgba(black, 0.38),
);
// Foreground palette for dark themes.
$mat-dark-theme-foreground: (
base: white,
divider: $light-dividers,
dividers: $light-dividers,
disabled: $light-disabled-text,
disabled-button: rgba(white, 0.3),
disabled-text: $light-disabled-text,
elevation: black,
hint-text: $light-disabled-text,
secondary-text: $light-secondary-text,
icon: white,
icons: white,
text: white,
slider-min: white,
slider-off: rgba(white, 0.3),
slider-off-active: rgba(white, 0.3),
);
I'm not great at scss yet but I think we need to create another set of
Only question is where do we determine dark vs light theme so we can style foreground differently.
from angular-material-css-vars.
I'm not great at scss yet but I think we need to create another set of
of what? :)
Not sure if I follow you. The selectors for the dark theme is applied here:
from angular-material-css-vars.
I was mistaken ignore my comments on first post.
I made a pull request with a workaround. Not sure if this is acceptable.
#36
I need to understand why that alpha is being set to 1 when it should be 0.38, or 0.5 in dark mode. It actually works in dark mode. Added test case to demo app so you can see what I mean.
from angular-material-css-vars.
Related Issues (20)
- V15 MDC Fixes HOT 32
- How to use it with Angular 14 HOT 6
- Opacity Broken in mat-css-color utility HOT 1
- Docs on $mat-css-dark-theme-selector and $mat-css-light-theme-selector not accurate HOT 3
- Legacy Checkbox - checkmark not displayed anymore HOT 1
- Material 15: Usage of default palettes HOT 3
- Foreground and Background mapping HOT 3
- Setting Variables and Styles with default material mixins HOT 4
- v5.0.0-next.0: SassError: Undefined mixin @include app-theme($mat-css-theme); HOT 3
- Allow setting theme on a specific element HOT 3
- Is it possible to disable "isDarkTheme" specific css? HOT 3
- Contrast color edge cases & slightly different dark text color HOT 1
- Checkbox check mark bad contrast in dark mode
- Angular 17 support
- mixin `mat-css-set-palette-defaults` not generating any code HOT 5
- Offer standalone friendly APIs
- Bug: Material Button background color broken on mouse down after the newest angular update HOT 6
- Mini FAB not using the right contrast color
- M3 theme support HOT 2
- Bundle size gets ridiculously large HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-material-css-vars.