CSS on Steroids Dr David Stearns Autumn 2013 and.

Slides:



Advertisements
Similar presentations
The Future of CSS and JavaScript Today Daniel Laughland Forward Thinking.
Advertisements

Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
Web Development & Design Foundations with HTML5
Introduction to Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 4.
More HTML Chapter 4. 2 Nesting Tags How do you write the following in HTML? The wrong way: This is really, REALLY fun ! Tags must be correctly nested.
© 2007 D. J. Foreman CSS-1 Cascading Style Sheets Styles.
CHAPTER 24 PERFORMING CSS TRANSITIONS AND ANIMATIONS.
CS7026 – CSS3 CSS3 – Transitions & Animations. Animating the Change with Pure CSS 2  Another nice enhancement to our heading highlight would be to either.
Principles of Web Design 6 th Edition Chapter 4 – Cascading Style Sheets.
Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Cascading Style Sheets CS3505. What are CSS? Method for adding style attributes consistently to HML tags Cascading because styles are applied in order.
HTML - Quiz #2 Attendance CODE:
Dreamweaver -- CSS. Dreamweaver -- MX New icons are added in MX Most of the features commonly used in web design, and are same as FrontPage. New feature.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
SCHOOL OF LIBRARY, ARCHIVE AND INFORMATION STUDIES Andy Dawson LIS1510 Library and Archives Automation Issues Further features of HTML – Stylesheets and.
Week 4.  Three ways to apply CSS: Inline CSS Internal style sheets ( header style information) External style sheets.
By: Gerald Fry introducingCompass.
Webpage design for researchers Dr Jim Briggs 1.
Today’s objectives  Complete web page  Using xhtml & CSS  Adding CSS to documents Embed url(File);  CSS.
Today’s objectives  Presentational | Inline | Block | Validate  CSS | Rules | Declarations.
CSS Best Practices By Peter Funk 1. Web development since 1996 Senior Front-end web developer at Ancestry.com Proficient at CSS, HTML, and native JavaScript.
Introduction to CS520/CS596_026 Lecture One Gordon Tian Fall 2015.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
1 WDMD 170 – UW Stevens Point WDMD 170 Internet Languages eLesson: CSS Introduction to Style Sheets (NON-audio version) © Dr. David C. Gibbs
Cascading Style Sheets
CIS67 Foundations for Creating Web Pages Professor Al Fichera Rev. September 14, 2010—All HTML code brought to XHTML standards. Reference for CIS127 and.
Cascading Style Sheets Orientation Learning Web Design: Chapter 11.
Class three: CSS review, backgrounds, font formatting, the box model.
Michigan.gov - Style Sheets (CSS) Adding Style And Layout To HTML.
Cascading Style Sheets. What is CSS? Short for Cascading Style Sheets, a new feature being added to HTML that gives more control over how pages are displayed.
Cascading Style Sheets Class 2, Lecture 2 Rachel A Ober
CSS Cascading Style Sheets. CSS Advantages Greater typography and page layout control Style is separate from structure Styles can be stored in a separate.
HTML - Quiz #2 Attendance CODE:
Fonts The following CSS properties will be described: 1.Font-family 2.Font-style 3.Font-variant 4.Font-weight 5.Font-size 6.Font.
Extended Features: Frames and Style Sheets Rebecca Manning Wells College.
CS 142 Lecture Notes: CSSSlide 1 CSS Rule body { font-family: Tahoma, Arial, sans-serif; color: black; background: white; margin: 8px; } Selector Declaration.
Lesson 03 // Cascading Style Sheets. CSS Stands for Cascading Style Sheets. We’ll be using a combination of Html and CSS to create websites. CSS is a.
Using the CSS. What is CSS? CSS is a language that’s used to define the formatting applied to a Website, including colors, background images, typefaces.
Session I Chapter 1 - Introduction to Web Development
CSS WORKSHOP Design Principles for Web Standards.
Advanced Web Development Instructor: Thomas Bombach.
CSS PREPROCESSORS Michael and Miles. Overview What are CSS Preprocessors Why use them? What is LESS and how to use LESS example What is SASS and how to.
SASS & LESS Syntactically Awesome StyleSheets Dynamic StyleSheet Language Svetlin Nakov Technical Trainer Software University
Cascading Style Sheets
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
CSS Cascading Style Sheets. Cascading Style Sheet (CSS) A cascading style sheet (CSS) is a set of rules that define styles to be applied to entire Web.
Cascading Style Sheets (CSS). A style sheet is a document which describes the presentation semantics of a document written in a mark-up language such.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with CSS.
Introduction to CSS. Why CSS? CSS Provides Efficiency in Design and Updates CSS relatively easy to use Can give you more flexibility and control Faster.
Microsoft Expression Web-Illustrated Unit F: Enhancing a Design with CSS.
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations Slide Set #4: CSS.
Cascading Style Sheets Primary readings Presentations Explain & review projects with class mates.
 HTML, CSS, JavaScript – enormously successful  SASS has all the tools we need! INTRO.
Developing Web Applications with HTML and CSS “Selectors and Properties”
Review First – on your own... Go to Day 5 Grab the contents of position review file Place in DW Add styles to recreate – get something close to
NASRULLAHIBA.  It is time to take your web designing skills to the next level with Cascading Style Sheets (CSS). They are a way to control the look and.
We are currently doing on client projects #1 Commenting old style rules and defining new rule for the section we want to change the css rule. #2 Redefining.
Cascading Style Sheet Fix the Errors Lesson 4. / Pat Learner / h1, h2, h3, h4 { font-family: tahoma, arial, helvetica, sans-serif text-align: left; }.skyblue.
JavaScript IV Robin Burke ECT 270. Outline Final project reminder Style review Manipulating style Special effect examples.
PERSPECTIVES: TUTORIAL 4 CREATING PAGE LAYOUTS WITH CSS.
Session V CSS Precompilers and Vulnerabilities 8/1/2014Copyright © Carl M. Burnett1.
Introduction to CS520/CS596_026 Lecture One Gordon Tian Fall 2015.
CSS Introductions. Objectives To take control of the appearance of a Web site by creating style sheets. To use a style sheet to give all the pages of.
Sass & Compass CPSC 473 – Spring 2011 Charles Wang Bryan Perez.
Cascading Style Sheets (CSS) is a simple mechanism for adding style (e.g., fonts, colors, spacing) to Web documents Dr. Irwan Sembiring,ST.,M.Kom.
Introduction to.
Simple theme creation using Sass
Presentation transcript:

CSS on Steroids Dr David Stearns Autumn 2013 and

What are SASS and LESS? Extensions to the CSS language to support large-scale, complex projects Tools that compile those extensions into CSS the browser can actually read

styles.less LESS compiler LESS compiler styles.css input output LESS file that uses various language extensions Standard CSS file that browsers can understand

What’s the Difference? Language extensions are nearly identical, with a few specialized features here and there SASS is built on Ruby; LESS is built on JavaScript Both require a compile operation, but LESS has support for compiling in the browser

Language Extensions Variables for values used in multiple #FFB873; h1 { } footer { } LESS ( SASS uses $ instead ) h1 { color: #FF7F40; } footer { background-color: #FFB873; } Compiled CSS

Language Extensions Mix-Ins for sets of related 1s) { -webkit-transition: -moz-transition: -o-transition: -ms-transition: transition: } nav a {.trans; }.thumbs img {.trans(0.5s); } LESS ( SASS uses slightly different syntax ) nav a { -webkit-transition: all 1s; -moz-transition: all 1s; -o-transition: all 1s; -ms-transition: all 1s; transition: all 1s; }.thumbs img { -webkit-transition: all 0.5s; -moz-transition: all 0.5s; -o-transition: all 0.5s; -ms-transition: all 0.5s; transition: all 0.5s; } Compiled CSS

Language Extensions Nested Rules nav { background-color: #CCC; li { display: inline-block; } a { display: inline-block; padding: 1em; } SASS and LESS (same syntax) nav { background-color: #CCC; } nav li { display: inline-block; } nav a { display: inline-block; padding: 1em; } Compiled CSS

Language Extensions Rule Inheritance.headings { font-family: Arial, sans-serif; font-weight: bold; color: #0E0E0E; margin-bottom: 0.5em; } h1:extend(.headings) { font-size: 200%; } h2:extend(.headings) { font-size: 150%; } LESS ( SASS uses slightly different syntax ) h1, h2 { font-family: Arial, sans-serif; font-weight: bold; color: #0E0E0E; margin-bottom: 0.5em; } h1 { font-size: 200%; } h2 { font-size: 150%; } Compiled CSS

Language Extensions Functions and #FFE873; h1 { color: 10%); } footer { background-color: 50%); } footer:hover { } LESS ( SASS has Similar Functions via Compass )

LESS Usage During development, use less.js to compile LESS files to CSS on the client: For production, use command-line compiler to make final CSS file and link to that: lessc less/styles.less > css/styles.css Install LESS using Package Manager that comes with Node.js:LESSNode.js npm install -g less

SASS Usage Use command-line compiler to make CSS file: sass sass/styles.scss css/styles.css Use “Watch Mode” to automatically re-compile whenever.scss file changes sass --watch sass/styles.scss:css/styles.css Install SASS using Ruby:SASSRuby sudo gem install sass