I'm trying to create a dark theme and the code doesn't allow you to set a custom hue for background or accent:
http://codepen.io/anon/pen/KagLoJ
Hue is always overridden.
Below works for me, and I believe follows the intent. Set a default Hue value for accent and background but only if you haven't provided it with your theme:
diff --git a/src/core/components/mdTheme/index.js b/src/core/components/mdTheme/index.js
index fa8e2f9..c6c7ccd 100644
--- a/src/core/components/mdTheme/index.js
+++ b/src/core/components/mdTheme/index.js
@@ -62,9 +62,7 @@ const parseStyle = (style, theme) => {
}
if (colorType === 'COLOR') {
- let isDefault = palette[theme[type]];
-
- if (!hue && !isDefault) {
+ if (!theme[type] || !theme[type].hasOwnProperty('hue')) {
if (type === 'accent') {
colorVariant = 'A200';
} else if (type === 'background') {
I will change that. The background is hardcoded. Sorry about that.
Am I right that same problem exists if you try to overwrite the default theme?
Vue.material.registerTheme('default', {
primary: 'indigo',
accent: {
color: 'indigo',
hue: 700
},
warn: 'red',
})
Accent applies indigo color, but not hue 700.
Yeah. It seems that it takes a lighter hue from the specified color
It would be nice if the background displayed the correct shade.
Same problem here, I just used my own CSS and added !important to the tags
+1
+1
+1
+1
+1
Closing this issue as our focus is on the new 1.0.0 version.
Most helpful comment
I will change that. The background is hardcoded. Sorry about that.