Hey, friends! I'd love to open a discussion about how we might approach our variable names! I have a few fly-by thoughts that I'd love any insights on! :grin:
Introducing the Rule of 8
$globalSpacing: 8px;
One of the things we've been exploring with our designs is using the number 8 as a base of all of our spacing, margin, padding, heights, widths, etc. decisions! Here are a few examples:
Buttons:Small buttons might have a height of 24px where 24 is 8 * 3. From there, we'd have the font size at 12px (8+(8/2)) and then the left and right margins might be 8px giving us this:
Following this same ruling system, regular buttons might have a height of 32px where 32 is 8 * 4. From there, we'd have the font size at 14px (8+(8-(8/4))) and then the left and right margins might be 16px giving us this:
So, when building out the .Button classes, we might go for something like this:
I wonder how it might feel if when we started to write a lot of the same values, we perhaps explore making them variables? Super-curious for thoughts on this! :grinning:
Hey, friends! I'd love to open a discussion about how we might approach our variable names! I have a few fly-by thoughts that I'd love any insights on! :grin:
Introducing the Rule of 8
One of the things we've been exploring with our designs is using the number 8 as a base of all of our spacing, margin, padding, heights, widths, etc. decisions! Here are a few examples:
Buttons: Small buttons might have a height of
24px
where24
is8 * 3
. From there, we'd have the font size at12px
(8+(8/2)
) and then the left and right margins might be8px
giving us this:Following this same ruling system, regular buttons might have a height of
32px
where32
is8 * 4
. From there, we'd have the font size at14px
(8+(8-(8/4))
) and then the left and right margins might be16px
giving us this:So, when building out the
.Button
classes, we might go for something like this:Incorporating DRY
I wonder how it might feel if when we started to write a lot of the same values, we perhaps explore making them variables? Super-curious for thoughts on this! :grinning:
So, if we're working on a new
.Button
element, we might go ahead and write:Curious on any thoughts here! Love the conversations that are inspiring these thoughts! Super-excited to hear and learn more from you all! :grin: