Lead Front-End Engineer
@maxinacube
We study the design and know all the
pieces. It's time to start building.
New features are added but that's no big deal, right?
Do the styles for old features get removed with the markup?
This is where everything collides and turns a bad situation worse.
What repeats and can be reused?
Make suggestions about what can be reused, or even
what may be simplified for better performance
/**
* 01. Logo
* 02. Navigation
* 03. Mobile Navigation
* 04. Promo Banner
**/
// 01. Logo
// 02. Navigation
// 03. Mobile Navigation
// 04. Promo Banner
/**
* 01. Team single paragraph
**/
// 01. Team single paragraph
// @todo article.post .team-info .entry-content p needs
// to be refactored it is too specific
body.team .team-info article.post .entry-content p {
font-size: 1.25rem;
}
Break apart Sass files by type; global, page, plugin, config
Components can be pagination, comments, forms
While Posts and a CPT for Articles or News can be a 1-to-1, a staff post type or a location post type may have custom styles
Keeping plugins styles separate will make life easy
when a plugin is uninstalled or updates
Using variables, mixins, and functions
makes everything easier.
$black: #000;
$linchpin-blue: #3fc1d0;
$primary-color: $linchpin-blue;
$secondary-color: $black;
#wcri-slide {
background: $primary-color;
color: $secondary-color;
}
@mixin clearfix {
&:before,
&:after {
content: '';
display: table;
}
&:after {
clear: both;
}
}
#wcri-slide {
@include clearfix;
}
@function light-or-dark( $color ) {
$return-color: $black !default;
@if ( lightness( $color ) > 50% ) {
$return-color: $white;
}
@return $return-color;
}
• Gulp
• Grunt
• Compass
• Autoprefixer
• Minification
• CodePen.io
• JSFiddle.net
• CSSDesk.com
slides.com/maxinacube/wcri-2017