-
Notifications
You must be signed in to change notification settings - Fork 696
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
Converted CSS to SASS #1349
Converted CSS to SASS #1349
Conversation
7e56a35
to
5dd1d7c
Compare
Thanks for this PR, @heartsucker! I've been wanting to do this for a long time, since I agree CSS is terrible to work with compared to alternatives such as SASS. I'll review this by the end of the week. |
Hey guys. This is in need of some rebasing, but before I get to it, can someone take a look and let me know if this seems to be a good candidate for merge? |
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.
A quick question:
- Do you prefer using SASS over SCSS? We're comfortable with either format, but SCSS seems to be slightly more popular these days.
Overall, this PR looks great. If you rebase it and fix the other comments from this review, we will merge it.
'cyan'), | ||
lambda: DevServerProcess('SASS Compiler', | ||
['sass', '--watch', 'sass:static/css'], | ||
'magenta'), |
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.
Why is it necessary to add lambda
s and change DevServerProcessMonitor.__init__
? The commit message in 688b747 was unclear.
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 one of the subprocesses fails to start or throws and exception, the monitor will leave the other processes dangling. Each call to DevServerProccess needs a try/except around 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.
@heartsucker Thanks for the explanation! I'll take a look at this myself - I think there might be a way to more gracefully handle that case within DevServerProcess.
* HACK: Firefox likes to add non-existent leading and/or trailing whitespace | ||
* to <span>s, but never does it to <p>s. This hack uses a <p> for the | ||
* codename so we can get the right copy behavior, and uses inline-block plus | ||
* tweaks the margin to make it look like a span |
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.
Close this comment.
font-size: 14px | ||
|
||
p | ||
* |
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.
Is this line necessary?
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.
Probably not? I'm not a CSS expert, so I made as few changes as possible when porting it to SASS.
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.
@heartsucker Gotcha. Let's leave it in for now, it can be addressed in a follow-up if necessary.
{% assets filters="cssmin", output="gen/source.css", | ||
"css/normalize.css", "css/source.css", "css/font-awesome.css" %} | ||
|
||
{# TODO why doesn't a link to /static/source.css work? #} |
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.
We should resolve this TODO before merging. It's best not to leave TODOs in merged code, if possible.
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'll take a look at this since there have been some updates to some of the dependencies since I wrote this and the behavior might have changed. Also, suggestions welcome since this one seems a bit non-intuitive.
args: | ||
chdir: /tmp/{{ securedrop_app_code_deb }}/var/www/securedrop/ | ||
# register: sass_compile_result | ||
# changed_when: sass_compile_result.stdout != '' |
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 code is commented out, can it be removed?
@garrettr I'm not really a web frontend guy, but more a guy who can do some frontend stuff when he needs. I happened to do it in SASS because that's what I know, but some poking around does seem to indicate that there are more advantages to SCSS. If y'all want that, I can make those change along with all of the rest of this. |
Me either.
From a little research, I saw a decent amount of opinion to that point as well. E.g., http://thesassway.com/editorial/sass-vs-scss-which-syntax-is-better.
If that isn't too much work for you, it seems to me like that might be good, just because it seems like SCSS might be better for other contributors to work with in the future. Since I don't do much myself with the frontend codebase myself, I'm not going to make an absolute call one way or the other. Unless one of the other SD team members has strong opinions, we'll leave the decision up to you. |
@heartsucker I think SASS is fine. I polled some front-end folks that I know and people seem to be pretty evenly split on which one is "better". If we end up deciding to change to SCSS later, that seems to be trivial to do via |
a8e974a
to
039088b
Compare
This was tested on the dev VM, but it's not passing Travis because of this mystery:
It's saying the gem was installed (globally), but then it's not on the path. Anyone have any experience debugging the Travis environment? Also, I added verbosity to build in hopes that it might tell us something, but alas. This appears to be related: travis-ci/travis-ci#5861 |
0914b4b
to
35daa9d
Compare
Hey @heartsucker, I took a peek at this PR yesterday and it does look to be a weird PATH issue: one way to troubleshoot is to add a couple of post-install tasks in that Ansible play before you try to execute
Since you put those -vv verbosity flags (good call) you can inspect the output and see what's going on with the PATH. This might not be the Best Way to debug this but it’s what I do ¯\(ツ)/¯. Give that a whirl, if things still look confusing let me know and I’ll take a deeper look. |
@redshiftzero I already did most of that (and them some), but even when putting calls |
bab629e
to
d73e477
Compare
Pinging for review/merge. |
Doubling down on the request for merge because there are a bunch of UI tickets that got opened today, and it would be nice to do this first. |
@garrettr? @fowlslegs? @redshiftzero? Bueller? |
Whoa, sorry about the lag on this one, @heartsucker! Thanks for your persistence, getting this in pronto. (Yes, the hack in b9c78be is indeed adventurous approach, but it works well enough for the dev env!) |
I wanted to a add new features and CSS and is terrible to work with compared to SASS. This PR includes: