Soumettre la recherche
Mettre en ligne
Sass einfuehrung-t3camphh
•
1 j'aime
•
749 vues
Berit Hlubek
Suivre
Einführung in die CSS-Entwicklung mit SASS/SCSS
Lire moins
Lire la suite
Technologie
Signaler
Partager
Signaler
Partager
1 sur 36
Télécharger maintenant
Télécharger pour lire hors ligne
Recommandé
Future of Web Apps: Sass
Future of Web Apps: Sass
Hampton Catlin
Res 23-anvisa-15-mar-2000-registro alimentos
Res 23-anvisa-15-mar-2000-registro alimentos
UFU - Universidade Federal de Uberlândia
Nota d'Actualitat Econòmica Octubre de 2009
Nota d'Actualitat Econòmica Octubre de 2009
Cambra de Comerç de Barcelona
Una vida cristiana de proposito
Una vida cristiana de proposito
Joshua Gonzalez
OFFENSE
OFFENSE
BFLLEVEL1
A.i. 2006.002.27583
A.i. 2006.002.27583
kduferraro
Cac bai toan_ve_quy_hoach_dong
Cac bai toan_ve_quy_hoach_dong
oanhtin08
MABS
MABS
Tibor Kulcsár
Recommandé
Future of Web Apps: Sass
Future of Web Apps: Sass
Hampton Catlin
Res 23-anvisa-15-mar-2000-registro alimentos
Res 23-anvisa-15-mar-2000-registro alimentos
UFU - Universidade Federal de Uberlândia
Nota d'Actualitat Econòmica Octubre de 2009
Nota d'Actualitat Econòmica Octubre de 2009
Cambra de Comerç de Barcelona
Una vida cristiana de proposito
Una vida cristiana de proposito
Joshua Gonzalez
OFFENSE
OFFENSE
BFLLEVEL1
A.i. 2006.002.27583
A.i. 2006.002.27583
kduferraro
Cac bai toan_ve_quy_hoach_dong
Cac bai toan_ve_quy_hoach_dong
oanhtin08
MABS
MABS
Tibor Kulcsár
Me in 60 seconds
Me in 60 seconds
dll5954
Marshmallow snowman
Marshmallow snowman
Samantha Bixler
Technology integration in schools
Technology integration in schools
dll5954
Giving the gift of reading through arhs book
Giving the gift of reading through arhs book
Lisa Gallinatti
My vacation on pp
My vacation on pp
Samantha Bixler
Werken voor je plezier - Vrijwilligerswerk als vrije tijdsbesteding
Werken voor je plezier - Vrijwilligerswerk als vrije tijdsbesteding
WIJbegintbijjou
2010 september montly report
2010 september montly report
Lisa Gallinatti
Giving the gift of reading through arhs book
Giving the gift of reading through arhs book
Lisa Gallinatti
Welzijn in de 21e eeuw
Welzijn in de 21e eeuw
WIJbegintbijjou
Oma heeft geen tijd voor ons
Oma heeft geen tijd voor ons
WIJbegintbijjou
Getting involved with TYPO3
Getting involved with TYPO3
Berit Hlubek
Corporate financial management
Corporate financial management
Tarun Sharma
Getting Involved with TYPO3
Getting Involved with TYPO3
Berit Hlubek
Technology integration in schools
Technology integration in schools
dll5954
Save time by using SASS/SCSS
Save time by using SASS/SCSS
Berit Hlubek
Contenu connexe
En vedette
Me in 60 seconds
Me in 60 seconds
dll5954
Marshmallow snowman
Marshmallow snowman
Samantha Bixler
Technology integration in schools
Technology integration in schools
dll5954
Giving the gift of reading through arhs book
Giving the gift of reading through arhs book
Lisa Gallinatti
My vacation on pp
My vacation on pp
Samantha Bixler
Werken voor je plezier - Vrijwilligerswerk als vrije tijdsbesteding
Werken voor je plezier - Vrijwilligerswerk als vrije tijdsbesteding
WIJbegintbijjou
2010 september montly report
2010 september montly report
Lisa Gallinatti
Giving the gift of reading through arhs book
Giving the gift of reading through arhs book
Lisa Gallinatti
Welzijn in de 21e eeuw
Welzijn in de 21e eeuw
WIJbegintbijjou
Oma heeft geen tijd voor ons
Oma heeft geen tijd voor ons
WIJbegintbijjou
Getting involved with TYPO3
Getting involved with TYPO3
Berit Hlubek
Corporate financial management
Corporate financial management
Tarun Sharma
Getting Involved with TYPO3
Getting Involved with TYPO3
Berit Hlubek
Technology integration in schools
Technology integration in schools
dll5954
Save time by using SASS/SCSS
Save time by using SASS/SCSS
Berit Hlubek
En vedette
(15)
Me in 60 seconds
Me in 60 seconds
Marshmallow snowman
Marshmallow snowman
Technology integration in schools
Technology integration in schools
Giving the gift of reading through arhs book
Giving the gift of reading through arhs book
My vacation on pp
My vacation on pp
Werken voor je plezier - Vrijwilligerswerk als vrije tijdsbesteding
Werken voor je plezier - Vrijwilligerswerk als vrije tijdsbesteding
2010 september montly report
2010 september montly report
Giving the gift of reading through arhs book
Giving the gift of reading through arhs book
Welzijn in de 21e eeuw
Welzijn in de 21e eeuw
Oma heeft geen tijd voor ons
Oma heeft geen tijd voor ons
Getting involved with TYPO3
Getting involved with TYPO3
Corporate financial management
Corporate financial management
Getting Involved with TYPO3
Getting Involved with TYPO3
Technology integration in schools
Technology integration in schools
Save time by using SASS/SCSS
Save time by using SASS/SCSS
Sass einfuehrung-t3camphh
1.
SASS Strukturiertes CSS mit
SASS und sassify
2.
<head>
<link rel=“... <link rel=“... CSS HTML CSS CSS über <link> einfügen
3.
<html> ... <div style=“color: #abc;
padding: 2px“> ‘T ! HTML O N D Inline-CSS
4.
<div id=“header“>
#header { ... } <ul class=“menu“> #header ul.menu { ... } <li>Item 1</li> #header ul.menu li { ... } <li><a href=“#“>Item 2</a></li> #header ul.menu li a { ... } </ul> li a { ... } </div> <div id=“footer“> <ul><li> CSS <a href=“#>Impressum</a> </li></ul> </div> HTML Selektoren
5.
Schwächen von CSS
6.
Einheitliche Formatierung?
7.
Wiederholung von Eigenschaften
8.
Farben und Abstände
sind verteilt
9.
Lange Selektoren
10.
Importe sind langsam!
11.
SASS bzw. SCSS
12.
Compiler SCSS SCSS
CSS SCSS wird in CSS übersetzt
13.
CSS
SCSS CSS kann übernommen werden!
14.
Benutzung
15.
sass --watch imports.scss Änderungen
überwachen
16.
CSS Erweiterungen
17.
#header {
#header { ... ... } ul.menu { #header ul.menu li a { ... ... li { } ... #header ul.menu li { a{ ... refactor ... } } li a { } ... li a { } ... #header ul.menu { } ... } CSS SCSS Nesting
18.
#header ul.menu li
a { #header { color: #000; ul.menu { } li { #header ul.menu li a:hover { a{ color: #ccc; color: #000; } &:hover { color: #ccc; refactor } } } CSS SCSS Selektor Referenzen
19.
$grey: #c7c7c7;
$border-size: solid 1px; $border: $border-size $grey; #menu { #menu { ... ... border-left: solid 1px #c7c7c7; border-left: $border; border-top: solid 1px #c7c7c7; border-top: $border; border-right: solid 1px #c7c7c7; border-right: $border; } refactor } #rootline { #rootline { ... ... background-color: #c7c7c7; background-color: $grey; } } #content { #content { ... ... border-left: solid 1px #c7c7c7; border-left: $border; border-top: solid 1px #c7c7c7; border-top: $border; border-right: solid 1px #c7c7c7; border-right: $border; } CSS } SCSS Variablen
20.
$total-width: 600px;
$sidebar-width: 100px; $spacing: 20px; #content { #content { width: 500px; width: $total-width - $sidebar-width; padding: 40px; padding: $spacing * 2; } } #sidebar { refactor #sidebar { width: 100px; width: $sidebar-width; margin-left: 20px; margin-left: $spacing; } } CSS SCSS Berechnungen
21.
$color: #777777;
#content { compile background-color: #444444; } #content { background-color: darken($color, 20%); h2 { } color: #f6f6f6; } h2 { color: lighten($color, 50%); } SCSS Funktionen (vordefiniert)
22.
Funktionen
http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html adjust_hue(color, degrees) alpha(color) percentage(value) complement(color) blue(color) unit(number) darken(color, amount) green(color) unitless(number) desaturate(color, amount) hue(color) grayscale(color) red(color) quote(str) lighten(color, amount) opacity(color) unquote(str) mix(color1, color2, weight) lightness(color) opacify(color, amount) saturation(color) saturate(color, amount) transparentize(color, amount) abs(value) ceil(value) hsl(hue, saturation, lightness) floor(value) hsla(hue, saturation, lightness, round(value) alpha) rgb(red, green, blue) comparable(number1, number2) rgba(red, green, blue, alpha) type_of(obj) rgba(color, alpha)
23.
@mixin list-style-none {
#inhalt .text_container ul { list-style-image: none; list-style-image: none; list-style-position: outside; list-style-position: outside; list-style-type: none; list-style-type: none; } text-align: left; #inhalt { margin: 0px 0px 15px 15px; .text_container ul { padding: 0px 0px 0px 0px; } @include list-style-none; #inhalt .text_container ul li { compile margin: 0px 0px 15px 15px; list-style-image: none; padding: 0px 0px 0px 0px; list-style-position: outside; li { list-style-type: none; @include list-style-none; background-image: ...; background-image: ...; background-repeat: no-repeat; margin: 0px 0px 0px 0px; text-align: left; padding: 0px 0px 0px 15px; margin: 0px 0px 0px 0px; } padding: 0px 0px 0px 15px; } } } SCSS CSS Mixins
24.
@mixin rounded-border($width, $color,
$radius) { border-width: $width; border-style: solid; border-color: $color; border-radius: $radius; -moz-border-radius: $radius; -webkit-border-radius: $radius; } div.menu { @include rounded-border(1px, #770000, 10px); width: 300px; } div.sidebar { @include rounded-border(2px, #000000, 5px); } SCSS Mixins mit Argumenten
25.
$color = #cc7700;
#inhalt { compile background-color: #663c00; } @import "a.scss"; @import "b.scss"; h2 { SCSS color: #cc7700; } #inhalt { background-color: darken($color, 20%); } a.scss h2 { color: $color; } b.scss CSS Echte Imports
26.
.error {
.error, .serious-error { border: 1px #f00; compile border: 1px #f00; background-color: #fdd; background-color: #fdd; } } .serious-error { @extend .error; .serious-error { border-width: 3px; border-width: 3px; } } SCSS CSS Styles erweitern
27.
.error {
.error, .serious-error { border: 1px #f00; compile border: 1px #f00; background-color: #fdd; background-color: #fdd; } } .error-icon { background-image: url("error.png"); .error-icon, .serious-error { } background-image: url("error.png"); .serious-error { } @extend .error; @extend .error-icon; .serious-error { border-width: 3px; border-width: 3px; } } SCSS CSS Styles erweitern (mehrfach)
28.
$type: business;
p{ p{ compile color: green; } @if $type == ocean { color: blue; } @else if $type == matador { color: red; } @else if $type == monster { color: green; } @else { color: black; } } SCSS CSS Kontrollstrukturen / if
29.
@for $i from
1 through 3 { h1 { h#{$i} { compile font-size: 0.8em; } font-size: 1em - (0.2 * $i); } h2 { } font-size: 0.6em; } h3 { font-size: 0.4em; } SCSS CSS Kontrollstrukturen / for
30.
/*
/* * Mehrzeiliges CSS Kommentar compile * Mehrzeiliges CSS Kommentar */ */ body { color: black; } body { color: black; } // Einzeiliges, internes Kommentar a { color: green } a{ color: green; } SCSS CSS Kommentare
31.
Windows
32.
Installation ■ RubyInstaller (http://www.ruby-lang.org/de/downloads/) ■
Sass Gem installieren: gem install sass --pre
33.
Debugging
34.
sass -g imports.scss
> imports.css FireSass Firebug Extension
35.
sass -i Berechnungen testen
36.
sassify Demo
Télécharger maintenant