Session IV Chapter 20 - How to use SASS and Less

Slides:



Advertisements
Similar presentations
Sharpen Your MVC Views with Razor By Jon Marozick.
Advertisements

The Future of CSS and JavaScript Today Daniel Laughland Forward Thinking.
Using LESS for more maintainable, semantic, and lean web sites Keith Zantow.
An Introduction to Eric Bollens ebollens AT oit.ucla.edu Mobile Web Framework Architect UCLA Office of Information Technology August 4, 2011.
Chapter 4 Dreamweaver: Part II The Web Warrior Guide to Web Design Technologies.
Object Oriented CSS Creative Director Deeson Online twitter.com/graemeblackwood Graeme Blackwood.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Philly.NET Hands-on Labs JAVASCRIPT SERIES. July 9: JavaScript Syntax Visual Studio ◦Projects ◦Editors ◦Debugging ◦Script blocks ◦Minification and bundling.
ASP.NET + Ajax Jesper Tørresø ITNET2 F08. Ajax Ajax (Asynchronous JavaScript and XML) A group of interrelated web development techniques used for creating.
By: Gerald Fry introducingCompass.
SCALING CSS (FOR LARGE WEB SITES) Tips, best practices and recommended methodologies for organizing and managing CSS for large web sites.
ASP.NET &.NET Environment. Overview Part of Microsoft’s.NET environment Used for Development of  Websites  Internet applications  Web Services & XML.
Session I Chapter 1 - Introduction to Web Development
Session: 1. © Aptech Ltd. 2Introduction to the Web / Session 1  Explain the evolution of HTML  Explain the page structure used by HTML  List the drawbacks.
Crazy New CSS Tools MIS 424 MIS 424 Professor Sandvig Professor Sandvig.
SASS & LESS Syntactically Awesome StyleSheets Dynamic StyleSheet Language Svetlin Nakov Technical Trainer Software University
1 CSS-PREPROCESSORS as a way to speed up the process of interfaces developing and achieve Customer goals DMITRY SHURSHILIN AUGUST 3, 2015.
PERFORMANCE ENHANCEMENT IN ASP.NET By Hassan Tariq Session #1.
Session 1 Chapter 1 - Introduction to Web Development ITI 133: HTML5 Desktop and Mobile Level I
learn. do. dream. Bootstrapping with Twitter Bootstrap Responsive Layouts CSS Components JavaScript Font Awesome Select2 Themes.
Martin Kruliš by Martin Kruliš (v1.0)1.
Introduction to ASP.NET development. Background ASP released in 1996 ASP supported for a minimum 10 years from Windows 8 release ASP.Net 1.0 released.
1/7/2016www.infocampus.co.in1. 1/7/2016www.infocampus.co.in2 Web Development training gives you and all-round training in both the design and the development.
Session V CSS Precompilers and Vulnerabilities 8/1/2014Copyright © Carl M. Burnett1.
Britt BodinNatalie Thomson. AGENDA I. The Problems with CSS II. Introducing Preprocessors III. How They Work IV. It’s Magic. V. Advantages & Disadvantages.
Teaching slides Chapter 6. Chapter 6 Software user interface design & construction Contents Introduction Graphical user interface – Rich window based.
Simple theme creation using Sass
The Share Widget Library
What’s New In Bootstrap v4?
Advanced Web Page Styling
© 2016, Mike Murach & Associates, Inc.
THEAMING WITH SASS Bringing sassy to CSS SITRA.
Michael Robertson Yuta Takayama Google Closure Tools.
ITI 133 HTML5 Desktop and Mobile Level I
Responsive Web Applications with Bootstrap & CSS
Course Review HTML5 Level II Course Review
CSS PreProcessors MIS 424.
Course Review HTML5 Level II Course Review
HTML5 Level I Session II Chapter 3 - How to Use HTML to Structure a Web Page
HTML5 Session III Chapter 5 - How to Use the CSS Box Model for Spacing, Borders, and Backgrounds Chapter 6 - How to use CSS for page.
Web Development Using ASP .NET
HTML5 Level I Session III
HTML5 Level I Session III
Session I Chapter 18 - How to Design a Web Site
CMP Creating Your Personal and Small Business Web Sites
HTML5 Level I Session I Chapter 1 - Introduction to Web Development
Chapter 11 - How to use jQuery plugins and jQuery UI Widgets
Course Review ITI HTML5 Level II Course Review
Session VI Chapter 8 - How to Use Responsive Web Design (RWD)
Session I – Responsive Web Design (RWD) Overview 8/31/2015
ASP.NET Module Subtitle.
Master a Skill / Learn for Life
ITI 239 HTML5 Desktop and Mobile Level I
HTML5 Level I CyberAdvantage
Course Review HTML5 Level II Course Review
Course Review HTML5 Level II Course Review
HTML5 Course Review Master a Skill / Learn for Life.
HTML / CSS Mai Moustafa Senior Web Designer eSpace eSpace.
ITI 163: Web, Mobile, and Social Media Design Introduction
ხელმძღვანელი: დიმიტრი ქარაული
Master a Skill / Learn for Life
ASP.NET Imran Rashid CTO at ManiWeber Technologies.
HTML5 Level I CyberAdvantage
Session IV Chapter 15 - How Work with Fonts and Printing
ITI 133: HTML5 Desktop and Mobile Level I
Introduction to ASP.NET Parts 1 & 2
Course Review HTML5 Level I Course Review
© 2017, Mike Murach & Associates, Inc.
ITI 133: HTML5 Desktop and Mobile Level I
Presentation transcript:

Session IV Chapter 20 - How to use SASS and Less CSS3 Session IV Chapter 20 - How to use SASS and Less www.profburnett.com Master a Skill / Learn for Life

Outline CSS Use CSS Methodologies CSS Precompliers and Postprocessors Comparison of CSS Processors SasS {less} Stylus PostCSS 5/27/2019 Copyright © 2007 - 2018 Carl M. Burnett

CSS Use CSS for basic styling CSS for layout Float Flexbox Grid 5/27/2019 Copyright © 2007 - 2018 Carl M. Burnett

No CSS 5/27/2019 Copyright © 2007 - 2018 Carl M. Burnett

CSS for Basic Styling (Early 1990’s) 5/27/2019 Copyright © 2007 - 2018 Carl M. Burnett

CSS for Layout (1999) 5/27/2019 Copyright © 2007 - 2018 Carl M. Burnett

Float-Based CSS Layout (2006) 5/27/2019 Copyright © 2007 - 2018 Carl M. Burnett

Flexbox-based CSS Layout (2015) 5/27/2019 Copyright © 2007 - 2018 Carl M. Burnett

Grid-based CSS Layout (2018) 5/27/2019 Copyright © 2007 - 2018 Carl M. Burnett

CSS Methodologies 5/27/2019 Copyright © 2007 - 2018 Carl M. Burnett

Strategy & Structure Style Architecture Performance Driven Selectors Reusable Code Minify & Compress Files Reduce HTTP Requests Cache Common Files Ref: http://learn.shayhowe.com/advanced-html-css/performance-organization/ 8/31/2015 Copyright © 2007 - 2019 Profburnett.com

Style Architecture Responsive Web Design (RWD) Object Oriented CSS (OOCSS) Scalable & Modular Architecture for CSS (SMACSS) Adaptive Web Design (AWD) BEM (Block, Element, Modifier) 8/31/2015 Copyright © 2007 - 2019 Profburnett.com

Object Oriented CSS Separation of Structure From Skin Separation of Containers and Content The Benefits Of OOCSS Faster Websites Maintainable Stylesheets Ref: http://www.smashingmagazine.com/2011/12/an-introduction-to-object-oriented-css-oocss/ 8/31/2015 Copyright © 2007 - 2019 Profburnett.com

Scalable & Modular Architecture for CSS Categorizing CSS Rules Base Layout Module State Theme Depth of Applicability Selector Performance HTML5 and SMACSS Prototyping Preprocessors Drop the Base The Icon Module Complicated Inheritance Ref: https://smacss.com/ 8/31/2015 Copyright © 2007 - 2019 Profburnett.com

Adaptive Web Design Three layers of Progressive Enhancement Content layer = rich semantic HTML markup Presentation layer = CSS and styling Client-side scripting layer = JavaScript or jQuery behaviors Ref: http://www.techrepublic.com/blog/web-designer/what-is-the-difference-between-responsive-vs-adaptive-web-design/ 8/31/2015 Copyright © 2007 - 2019 Profburnett.com

Performance Driven Selectors Favor Classes Keep Selectors Short /* Bad */ header nav ul li a {...} /* Good */ .primary-link {...} button strong span {...} button strong span .callout {...} button span {...} button .callout {...} /* Bad */ #container header nav {...} /* Good */ .primary-nav {...} article.feat-post {...} .feat-post {...} Ref: http://learn.shayhowe.com/advanced-html-css/performance-organization/#performance-driven-selectors 8/31/2015 Copyright © 2007 - 2019 Profburnett.com

Reusable Code /* Bad */ .news { background: #eee; border-radius: 5px; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25); } .social { /* Good */ .news, .social { background: #eee; border-radius: 5px; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25); } /* Even Better */ .modal { background: #eee; border-radius: 5px; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25); } Ref: http://learn.shayhowe.com/advanced-html-css/performance-organization/#reusable-code 8/31/2015 Copyright © 2007 - 2019 Profburnett.com

Minify & Compress Files JavaScript Minifiers Packer JSMin Closure compiler YUICompressor (also does CSS) AjaxMin (also does CSS) CSS Minifiers CSSTidy Minify YUICompressor (also does JS) AjaxMin (also does JS) CSSCompressor Others YUICompressor - .NET Port that can compress on the fly or at build time. Also on NuGet. AjaxMin  - Has MSBuild tasks and can be integrated into your project's build. SquishIt - Used at runtime in your ASP.NET applications' views and does magic at runtime. Chirpy - "Mashes, minifies, and validates your javascript, stylesheet, and dotless files." Combres - ".NET library which enables minification, compression, combination, and caching of JavaScript and CSS resources for ASP.NET and ASP.NET MVC web applications." Cassette by Andrew Davey - Does it all, compiles CoffeeScript, script combining, smart about debug- and release-time. https://www.hanselman.com/blog/TheImportanceAndEaseOfMinifyingYourCSSAndJavaScriptAndOptimizingPNGsForYourBlogOrWebsite.aspx 8/31/2015 Copyright © 2007 - 2019 Profburnett.com

Reduce HTTP Requests Combine Like Files Image Sprites Image Data URI AJAX Ref: http://learn.shayhowe.com/advanced-html-css/performance-organization/#reduce-http-requests 8/31/2015 Copyright © 2007 - 2019 Profburnett.com

Cache Common Files ExpiresByType text/css "access plus 1 year" ExpiresByType application/javascript "access plus 1 year" Ref: http://learn.shayhowe.com/advanced-html-css/performance-organization/#performance-driven-selectors 8/31/2015 Copyright © 2007 - 2019 Profburnett.com

CSS Precompilers (Pre-Processors) Sass SCSS Less.js Stylus CSS-Crush Myth Rework 5/27/2019 Copyright © 2007 - 2018 Carl M. Burnett

CSS Postprocessors PostCSS Pleeease Bless CSSNext Stylecow -prefix-free 5/27/2019 Copyright © 2007 - 2018 Carl M. Burnett

Comparison of CSS Processors 5/27/2019 Copyright © 2007 - 2018 Carl M. Burnett

Comparison of CSS Processors 5/27/2019 Copyright © 2007 - 2018 Carl M. Burnett

Sass (Syntactically Awesome StyleSheets) Fully CSS-compatible Language extensions such as variables, nesting, and mixins Many useful functions for manipulating colors and other values Advanced features like control directives for libraries Well-formatted, customizable output Variables Nesting Partials Import Mixins Inheritance Operators 5/27/2019 Copyright © 2007 - 2018 Carl M. Burnett

{less} - Leaner Style Sheets Backwards-compatible language extension for CSS. JavaScript tool that converts your Less styles to CSS styles. Variables Mixins Nesting Operations Escaping Functions Namespaces and Accessors Maps Scope 5/27/2019 Copyright © 2007 - 2018 Carl M. Burnett

Stylus Selectors Variables Interpolation Operators Mixins Functions Keyword Arguments Rest Params Conditionals Hashes Objects Iteration 5/27/2019 Copyright © 2007 - 2018 Carl M. Burnett

PostCSS Increase code readability with Autoprefixer Tomorrow’s CSS - PostCSS Preset Env The end of global CSS - CSS Modules Avoid errors in your CSS - stylelint Powerful grid system - LostGrid PostCSS plugins 5/27/2019 Copyright © 2007 - 2018 Carl M. Burnett

CSS Tools CodeKit (Paid) Compass.app (Paid, Open Source) Ghostlab (Paid) Hammer (Paid) Koala (Open Source) LiveReload (Paid, Open Source) Prepros (Paid) Scout-App (Free, Open Source) 5/27/2019 Copyright © 2007 - 2018 Carl M. Burnett