-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
[WIP] Base themes #2541
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
[WIP] Base themes #2541
Conversation
import ColorManipulator from '../../utils/color-manipulator'; | ||
import Spacing from '../spacing'; | ||
import zIndex from '../zIndex'; | ||
import DarkBaseTheme from '../base-themes/dark-base-theme'; | ||
|
||
export default { |
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.
how about export default DarkBaseTheme;
?
@mbrookes nice work on the rename 👍 👍 Thanks ^_^ |
Also I think we'll need major rename across the documentation too. -_- |
I'm wondering, why are we uppercasing the first lettre of the theme files name. For instance |
Thanks @newoga, didn't know about deprecatedExport, but it looks like it's specific to components. When it comes to deprecation I'll take a look at @subjectix Yes, docs are the main place where the raw-theme naming is exposed, so will definitely need to be updated. Wanted to get a consensus on the approach before undertaking that change. @oliviertassinari - good question. I did wonder, but just followed current convention. |
@newoga - there is one option here: import LightBaseTheme from '../base-themes/light-base-theme';
import deprecatedExport from '../../utils/deprecatedExport';
LightBaseTheme.displayName = 'LightRawTheme';
export default deprecatedExport(
LightBaseTheme,
'material-ui/lib/styles/raw-themes/light-raw-theme',
'material-ui/lib/styles/base-themes/light-base-theme'
); But the resulting error message is a little confusing: "Warning: Importing LightRawTheme from 'material-ui/lib/styles/raw-themes/light-raw-theme' has been deprecated, use 'material-ui/lib/styles/base-themes/light-base-theme' instead." Is it 'LightRawTheme' or 'LightBaseTheme' at that point? |
@mbrookes That's one hell of a question :D :D Well I think we can be a little aggressive on this and call them |
@mbrookes @subjectix Haha! I agree, that's a very philosophical question 😆. I agree with @subjectix, if I had to pick between the two, Though @mbrookes has a good point, when we created this, it was originally designed for components. I suppose the easiest thing we could do is to modify the behavior of the For example: // Component.displayName = 'Component':
export default deprecatedExport(
Component,
'material-ui/lib/component',
'material-ui/lib/Component'
);
/* Warning: Importing Component from 'material-ui/lib/component' has been deprecated, use 'material-ui/lib/Component' instead. And with no displayName //UtilityObject.displayName is undefined:
export default deprecatedExport(
UtilityObject,
'material-ui/lib/utility-object',
'material-ui/lib/UtilityObject'
);
/* Warning: Importing from 'material-ui/lib/utility-object' has been deprecated, use 'material-ui/lib/UtilityObject' instead. |
Also, maybe we should call the files @oliviertassinari @subjectix Thoughts? |
@newoga I like the intuitive naming, but can we please drop the capitals from all over the place where the export is not a component ? -_- @oliviertassinari would agree :D |
So "lightBaseTheme.js" for the file name, and lightBaseTheme for the variable? That was my next question! :) @newoga - please could you adapt |
@subjectix Yes, I agree with you 👯. |
@subjectix I agree on making non-components @mbrookes I'll get that |
Thanks everyone for your feedbacks and hard work 👍 👍 |
@oliviertassinari @subjectix @mbrookes The changes to deprecatedExport are at #2564 |
Updated to camelCase and to use #2564. Todo:
|
@mbrookes don't touch the components yet. wait for them to use the theme hoc we'll do a whole re run at the latest stages before the 0.14.0 release |
@subjectix 👌 |
@mbrookes Could you add to the todo list to modify If that change is done, components that reference I wouldn't be opposed to you implementing that change now as long as we leave |
@mbrookes would it be ok with you if I base my work on your PR? I want to try to implement some theme related stuff, but these changes will conflict like hell :D so I'll base it on your work if that's ok 😁 |
Cool with me. Sorry I haven't caught up with the latest suggestions, but feel free to take this wherever you see fit - I can easily merge / rebase. |
@mbrookes Don't touch this PR anymore. I rebased, modified and updated your work. And based other works opon it 😁 Thanks for the help 👍 👍 |
I continued the work here in #2585 I'll close this PR. Please continue any further discussion there |
Work-in-progress to evaluate the impact of transitioning the naming of raw themes to base themes.