-
Notifications
You must be signed in to change notification settings - Fork 3
Conversation
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.
looks good! thanks for doing this, i really like where this is going. it made the stylesheets a LOT cleaner.
@@ -0,0 +1,62 @@ | |||
.fill | |||
&-width |
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.
wtf i didnt know you could do this
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 is a bit of a gotcha though: I don't think parent class traits propagate to child classes using this syntax, so anything defined under fill
needs to be applied using the @extends
directive on each child class
Could be wrong on this though
|
||
// padding declarations | ||
.pad | ||
&-sides |
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 think we might want to be more specific here like pad-sides-xl
so that we can vary the size of padding, but we can that on an ongoing basis
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.
Yeah, if we see the need for more we should add them on an ongoing basis - not sure if this is xl
or not quite yet 😋
@chamkank any thoughts on this? do you think it's good to go? Since this affects all of us, would like to make sure we all get an approval in 👍 |
<button | ||
onClick={onClick} | ||
type="submit" | ||
disabled={disabled} | ||
className="primary"> | ||
className={`primary ${className}`}> |
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.
Extensible 😍
Thanks guys! |
Closes #36
👷 Changes
Alright, so this ended up being a bit bigger than expected. Recommend reading this for the rationale behind my changes and what we should do with these going forward.
.flex
inutils.sass
- these are the flexbox utilities i mentionedbreakpoints.sass
, though these aren't in use yet. just to get the ball rolling on responsive designThen I started looking into getting these implemented as an example, and noticed that the Login page's style is super specific... guess it didnt seem too bad in the review. So I:
a
,h2
,p
- hopefully this helps with uniformityutils.sass
decorations.sass
for decorative styles, like shadows - other classes will need to be updated to use theseThe new stylesheet only declares constraints and super specific styles:
The resultant, clean, declarative JSX:
💭 Notes
The goal with this is to reduce style duplication as much as possible, and achieve a more uniform look. If all our
p
have the same margins, it would be far easier to set up new elements that look like they fit in, for example.This goes especially in padding - nothing looks weirder than padding that varies like crazy, so having a set of padding classes to choose from is a good idea. Plus, this means it'll be easier to implement responsiveness - for example, all classes with a certain padding class should lose/reduce their padding at the same breakpoints.
So why do all this instead of fancy, deeply nested styles that depend on a very specific hierarchy of elements? Because as soon as you move anything, say, one level of nesting deeper:
It also obscures a lot of the style logic, and makes it very hard to find what's doing what. More declarative classes = clearer style structures = happier time maintaining and adding to this stuff later on.
Also, just less styles in general. If additional variations are needed, just add subclasses.
For another example, see #41
🔦 Testing Instructions
make web
, everything should look the same