/styles/less is the default directory for LESS files
/styles/css is the default directory for css files that have been compiled from LESS
/styles/bin is the default directory for production-ready css files
We prefer LESS first, SCSS second (not SASS).
- use the following LESS files for initial setup
- variables.less
- mixins.less
- utilities.less
- compile with source maps for easier debugging
- use a LESS file for each View (or template file if not using views)
- Name the less file the name of the view
First word(s) should describe the CSS rule/property, then add the suffix that describes the variation.
Variables use dash-case
Mixins use snake_case
Only use the following when using sizes:
-xs
-sm
-md
-lg
-xl
-default which is set to one of the above
Using three (or so) utility classes (eg. <div class="h2 heading-serif text-align-left padding-sm">) is more descriptive than using a million different unique classes (eg. <div class="leftside-upsell-block-title">). If using more than 3 utility classes, look to create a component class that would be used in other places. If unique to this one element, then make it clear it's unique.
NEVER abbreviate a css property or rule! Use the full property name to avoid confusion:
/* GOOD */
.padding-top-sm {}
.font-size-sm {}
.text-align-left {}
/* BAD */
.pad-top-sm {}
.fz-sm {}
.a-left {}
If we DO use variations, we should use emmet's CSS abbreviations as the standard.
Use more direct names (eg. red) than vague names (eg. danger):
.color-red {}
.background-green {}
Always use gray with ay. Never use ey.
Use color with suffix of percentage number (00-100) to describe hues of the same color (lightest to darkest) where 50% is the name of the color used.
@gray: #666;
@gray-00: lighten(@gray, 50%);
@gray-10: lighten(@gray, 40%);
@gray-20: lighten(@gray, 30%);
@gray-30: lighten(@gray, 20%);
@gray-40: lighten(@gray, 10%);
@gray-50: @gray;
@gray-60: darken(@gray, 10%);
@gray-70: darken(@gray, 20%);
@gray-80: darken(@gray, 30%);
@gray-90: darken(@gray, 40%);
@gray-100: darken(@gray, 50%);
For mixed colors (eg. yellow-gray), the first color should be the more color more visible (eg. red-orange for a color that's more red and orange-red that's more orange). Don't use more than two colors in a name. We're not doing Picasso with our CSS. ;)
Declare tag and heading class:
Any alt heading styles should have descriptive classes and begin with heading-:
.heading-sans-serif {}
.heading-serif {}
.heading-italics {}
Use the following classes for button:
.button {}
.button.button-lg {}
.button.background-green.color-white {}
@screen-xs - < 320px eg. watches
@screen-sm - 320px - 599px eg. mobile
@screen-md - 600px - 1079px eg. tablet
@screen-lg - 1080px - 2000px eg. desktop
@screen-xl - > 2000px eg. televisions