-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Switch CSS to using postcss, and implement a dark theme. #2973
Conversation
SVGs are all broken, and some of the more exotic colours haven't been updated. There's been no attempt to use SASS to remove duplication from the CSS yet. no attempt to switch it at runtime yet.
@@ -112,8 +113,17 @@ | |||
"minimist": "^1.2.0", | |||
"mkdirp": "^0.5.1", | |||
"mocha": "^2.4.5", | |||
"node-sass": "^4.1.1", |
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.
if we're not using SASS, let's not drag it in.
We can lose catw
too I think.
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.
ooops, thanks.
@@ -15,13 +15,8 @@ limitations under the License. | |||
*/ | |||
|
|||
.mx_FilePanel { | |||
-webkit-box-ordinal-group: 2; |
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.
it'd probably be good to keep refactoring the CSS separate from cleaning it up as much as possible, if nothing else to give an easier way to point blame if it starts doing something weird.
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.
oh, I might have misunderstood what's going on here - these are now automatically added by postcss?
I still wonder if we can have separate PRs: (1) start using postcss; (2) make use of it. But I can see it may not be worth it.
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.
Ideally yes, the postcss transition would be separate PR to the factoring out colours, and stripping out vendor prefixes, and theming. Unfortunately they all grew organically at the same time and I'm not convinced it's worth the faff to untangle them now. Future changes should be more reviewable.
|
||
echo "// autogenerated by rethemendex.sh" > _components.scss | ||
|
||
for i in `find . -iname _\*.scss | fgrep -v _components.scss`; |
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.
need more sort
, please
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.
done
@@ -30,7 +30,6 @@ require('babel-polyfill'); | |||
|
|||
// CSS requires: just putting them here for now as CSS is going to be |
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.
could do with a better explanation of what's going on here.
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.
i have absolutely no idea what's going on there; it predates me.
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.
Not sure that's an excuse for making it worse: for a start I think it is no longer the case that CSS is going to be refactored soon, since I think this is the refactoring alluded to.
Perhaps @dbkr can clarify, but I think you could getting rid of this comment and replace it with:
"Require common CSS here; this will make webpack process it into bundle.css. Our own CSS (which is themed) is imported via separate webpack entry points in webpack.config.js"
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.
happy to change the comment, but would defn prefer to understand what @dbkr had in mind in the first place
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.
This was pulling in all the CSS: components.css is the catted-together bundle of all the components' CSS and the others were various other ones we used. Requiring them here pulled them in to webpack's build process which pulled them through the extract text plugin, eventually getting the end CSS bundle out the other end.
The comment was me putting the CSS requires in the vector index file rather than working out if there was a better place to put them, as at the time there was a refactor on the horizon of how vector's CSS worked (although that never came to pass).
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.
TL;DR yes, I agree with @richvdh 's new comment
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.
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.
generally looks pretty sane to me. A few minor nits.
@richvdh ptal |
if (file.match(/^theme-(?!light\.)/)) { | ||
var match = file.match(/^bundles\/.*?\/theme-((?!light\.).*)\.css$/); | ||
if (match) { | ||
var title = match[1].charAt(0).toUpperCase() + match[1].slice(1); |
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.
Not convinced that this is anything to do with my webpack changes, but I won't split hairs.
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.
LGTM apart from complaining about comments
I know this doesn't merge yet, but wanted to get the PR started for initial review.
The rationale for switching to postcss is to get imports, variable expansion & autoprefixing. Originally this was SASS, but SASS doesn't give you autoprefixing and is a bit less flexible than postcss.
Themes are done using ye olde
rel="alternate stylesheet"
.