SASS.

Slides:



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

Slide 1 CMPS 211 Internet Programming Spring 2008 Dynamic Effects with Styles Chapter 12 2/6/08.
Very quick intro HTML and CSS. Sample html A Web Title.
Links.  Styling Links  Links can be styled with any CSS property (e.g. color, font-family, background-color).  Special for links are that they can.
Principles of Web Design 5 th Edition Chapter Nine Site Navigation.
Cascading Style Sheets By: Valerie Kuna. What are Cascading Style Sheets? Cascading Style Sheets (CSS) are a standard for specifying the presentation.
SM5312 week 11: CSS Menus & Navigation Bars1 An Introduction to Cascading Style Sheets CSS Menus and Navigation Bars Nick Foxall.
Advance CSS (Menu and Layout) Miftahul Huda. CSS Navigation MENU It's truly remarkable what can be achieved through CSS, especially with navigation menus.
Using CSS (Cascading Style Sheets) Effie Nadiv Edited by permission from author by Amir Kirsh.
With CSS, a color is most often specified by: a HEX value - like "#ff0000" an RGB value - like "rgb(255,0,0)" a color name - like "red“ Example h1.
CIS 1310 – HTML & CSS 6 Layout. CIS 1310 – HTML & CSS Learning Outcomes  Describe & Apply the CSS Box Model  Configure Float with CSS  Designate Positioning.
Cascading Style Sheet CSS CS1520 Ali Alanjawi. 2 TA Information Ali Alanjawi Homepage: Office:
Navigation Bars Level 2 Extended Certificate Unit B12 Doing Business Online.
Diliev.com & pLOVEdiv.com  DIliev.com.
Class four: the box model and positioning. is an HTML tag which allows you to create an element out of inline text. It doesn’t mean anything! try it:
Chapter 9. Links  When styling a link, you must tell CSS both what you want to style, and when you want the style to happen  Web browsers keep track.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Introduction to Programming the WWW I CMSC Summer 2004 Lecture 7.
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.
CSS Class 2 -Add margins to elements on a page. -Set width and height of elements. - CSS shorthand properties for box model. -Style links. -Style tables.
Week 8 – Part 2 Page Layout Basics Key Concepts 1.
>> More on CSS Selectors. Pre-requisite Open the file called sample.txt Copy the all the text from the file Open your browser and go to codepen.io Paste.
SASS & LESS Syntactically Awesome StyleSheets Dynamic StyleSheet Language Svetlin Nakov Technical Trainer Software University
Web Development & Design Foundations with HTML5 7th Edition
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Copyright © Osmosys O S M O S Y SO S M O S Y S D e p l o y i n g E x p e r i e n c e & E x p e r t i s e™ CSS Training.
NAVIGATION USING HTML TO SET UP THE BASIC STRUCTURE OF A NAV BAR.
WebD Introduction to CSS By Manik Rastogi.
CSS.
Cascading Style Sheets
More CSS.
Web Development Basics Lecture 3 – CSS 2
Semester - Review.
Unit 3 - Review.
More advanced HTML and CSS
>> The “Box” Model
What is CSS.
Creating Page Layouts with CSS
Web Developer & Design Foundations with XHTML
Cascading Style Sheets contd: Embedded Styles
Cascading Style Sheets
Advanced CSS Layout Lesson 5.
Cascading Style Sheets (Layout)
Web Systems & Technologies
Introduction to web design discussing which languages is used for website designing
Web Development & Design Foundations with HTML5 7th Edition
Chapter 7 Page Layout Basics Key Concepts
Web Development & Design Foundations with HTML5 8th Edition
Web Development & Design Foundations with HTML5
Cascading Style Sheets
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Basics of Web Design Chapter 7 Page Layout Basics Key Concepts
6 Layout.
Cascading Style Sheets
>> Dynamic CSS Selectors
More CSS.
Float Property Elements that seem to “float" on the right or left side of either the browser window or another element are often configured using.
List Properties Box Properties Pseudoclass
Web Development & Design Foundations with HTML5
Nov. 1, 2018 Drop-down menu.
Chapter 17 CSS transformations.
How to use the CSS box model for spacing, borders, and backgrounds
Create an Unordered List
Web Development & Design Foundations with HTML5
Session 4: CSS Positioning
Transitioning Opacity
Web Client Side Technologies Raneem Qaddoura
CGS 3066: Web Programming and Design Fall 2019 CSS Extra
Presentation transcript:

SASS

CSS + Convenient Shortcuts

A Simple Example

a { color: #f00; text-decoration: none; font-weight: bold; } CSS a { color: #f00; text-decoration: none; font-weight: bold; }

a { color: #f00; text-decoration: none; font-weight: bold; } SASS a { color: #f00; text-decoration: none; font-weight: bold; }

Gosh, That Was Tough

Intermission

1. Variables

Say we have a link, heading and a button.

CSS a { color: #f00; text-decoration: none; } h2 { font-size: 130%; .button { background: #f00; color: #fff;

CSS a, h2 { color: #f00; } a { text-decoration: none; h2 { font-size: 130%; .button { background: #f00; /* This sucks. */ color: #fff;

CSS .red { color: #f00; } a { text-decoration: none; h2 { font-size: 130%; .button { background: #f00; color: #fff; <h2 class=”red”>The Litany</h2> <p>I must not fear.</p> <p>Fear is the mind-killer.</p> <p>I will <a class=”red” href=”http://vegemite.com.au”>face my fear.</a></p> <p>I will let it pass through me.</p> <input class=”button” value=”Post this to your LiveJournal” type=”submit” />

SASS $highlightColor: #f00; a { color: $highlightColor; text-decoration: none; } h2 { font-size: 130%; .button { background: $highlightColor; color: #fff;

Wow

So Anyway.

2. Nesting

CSS .carousel { overflow: hidden; width: 250px; } .carousel ul.items { position: relative; } .carousel ul.items li { display: block; position: absolute; width: 250px; left: -250px; .carousel ul.items li a:link, .carousel ul.items li a:visited { display: block; height: 50px; .carousel ul.items li a:hover, .carousel ul.items li a:active { opacity: 0.8;

SASS .carousel { overflow: hidden; width: 250px; ul.items { position: relative; li { display: block; position: absolute; width: 250px; left: -250px; a { &:link, &:visited { display: block; height: 50px; } &:hover, &:active { display: block; height: 50px; } }

3. Mixins

CSS #about-us ul.options li { background-color: #fff; border-radius: 5px; } #search-results ul.products li { border-radius: 5px; background-image: url('/images/product/list/results.top.png'); background-repeat: repeat-x; } /* ... */ #navigation {

SASS @mixin redballoon-outline-box { background-color: #fff; border-radius: 5px; } /* ... */ #about-us ul.options li { @include redballoon-outline-box; } #navigation { @include redballoon-outline-box; } #search-results ul.products li { @include redballoon-outline-box; background-image: url('/images/product/list/results.top.png'); background-repeat: repeat-x; }

Sure. Just break it into a CSS class instead, though.

CSS <div id=”about-us”> <ul class=”options”><li class=”redballoon-outline-box red”>...</li></ul> </div> <ul id=”navigation” class=”redballoon-outline-box”> <li class=”red”>...</li> </ul> <div id=”search-results”> <ul class=”products”> <li class=”redballoon-outline-box”>...</li>

SASS <div id=”about-us”> <ul class=”options”><li>...</li></ul> </div> <ul id=”navigation”> <li>...</li> </ul> <div id=”search-results”> <ul class=”products”>

COMPASS

Convenient way to compile and keep Sass files together

+

Bunch of pre-written mixins

(including CSS3, colour-manipulation, resets, and spriting)

Demo Time