SlideShare a Scribd company logo
1 of 37
Download to read offline
Copyright © 2014 APEX Consulting
APEX Developers -
Do More With Less !!
Roel Hartman
2
LESS
Leaner CSS
SASS
Syntactically Awesome StyleSheets
SCSS
Sassy CSS
OOCSS
Object Oriented CSS
You need a CSS Expert
Issue 1
Your CSS File(s) grows
Issue 2
No CSS code re-use
Issue 3
CSS is fragile
Issue 4
CSS increases 1:1 with HTML
Result
16
Your Solution …
Separating Structure from Skin
#button {
width: 200px;
height: 50px;
padding: 10px;
border: solid 1px #ccc;
background: linear-gradient(#ccc, #222);
box-shadow: rgba(0, 0, 0, .5) 2px 2px 5px;
}
#box {
width: 400px;
overflow: hidden;
border: solid 1px #ccc;
background: linear-gradient(#ccc, #222);
box-shadow: rgba(0, 0, 0, .5) 2px 2px 5px;
}
#widget {
width: 500px;
min-height: 200px;
overflow: auto;
border: solid 1px #ccc;
background: linear-gradient(#ccc, #222);
box-shadow: rgba(0, 0, 0, .5) 2px 2px 5px;
}
<html>
<div id=“box”>
<button id=“button” />
</div>
<div id=“widget”></div>
</html>
#button {
width: 200px;
height: 50px;
padding: 10px;
border: solid 1px #ccc;
background: linear-gradient(#ccc, #222);
box-shadow: rgba(0, 0, 0, .5) 2px 2px 5px;
}
#box {
width: 400px;
overflow: hidden;
border: solid 1px #ccc;
background: linear-gradient(#ccc, #222);
box-shadow: rgba(0, 0, 0, .5) 2px 2px 5px;
}
#widget {
width: 500px;
min-height: 200px;
overflow: auto;
border: solid 1px #ccc;
background: linear-gradient(#ccc, #222);
box-shadow: rgba(0, 0, 0, .5) 2px 2px 5px;
}
#button {
width: 200px;
height: 50px;
padding: 10px;
border: solid 1px #ccc;
background: linear-gradient(#ccc, #222);
box-shadow: rgba(0, 0, 0, .5) 2px 2px 5px;
}
#box {
width: 400px;
overflow: hidden;
border: solid 1px #ccc;
background: linear-gradient(#ccc, #222);
box-shadow: rgba(0, 0, 0, .5) 2px 2px 5px;
}
#widget {
width: 500px;
min-height: 200px;
overflow: auto;
border: solid 1px #ccc;
background: linear-gradient(#ccc, #222);
box-shadow: rgba(0, 0, 0, .5) 2px 2px 5px;
}
.button {
width: 200px;
height: 50px;
}
.box {
width: 400px;
overflow: hidden;
}
.widget {
width: 500px;
min-height: 200px;
overflow: auto;
}
.skin {
border: solid 1px #ccc;
background: linear-gradient(#ccc, #222);
box-shadow: rgba(0, 0, 0, .5) 2px 2px 5px;
}
.button {
width: 200px;
height: 50px;
}
.box {
width: 400px;
overflow: hidden;
}
.widget {
width: 500px;
min-height: 200px;
overflow: auto;
}
.skin {
border: solid 1px #ccc;
background: linear-gradient(#ccc, #222);
box-shadow: rgba(0, 0, 0, .5) 2px 2px 5px;
}
<html>
<div class=“box skin”>
<button id=“button skin” />
</div>
<div id=“widget skin”></div>
</html>
Separating Structure from Skin
Separating Container from Content
div{
width: 200px;
height: 50px;
padding: 10px;
border: solid 1px #ccc;
}
div h3{
margin: 0px;
overflow: hidden;
border: solid 1px #ccc;
}
div p{
margin: 3px;
min-height: 200px;
overflow: auto;
border: solid 1px #ccc;
}
<html>
<div>
<h3>Header</h3>
</div>
<div>
<p>Paragraph</p>
</div>
</html>
.bordered{
border: solid 1px #ccc;
}
.container{
width: 200px;
height: 50px;
padding: 10px;
}
.region-header{
margin: 0px;
overflow: hidden;
}
.flexbox{
margin: 3px;
min-height: 200px;
overflow: auto;
}
<html>
<div class=“bordered container”>
<h3 class=“bordered region-header”>
Header
</h3>
</div>
<div class=“bordered container”>
<p class=“bordered flexbox”>Paragraph</p>
</div>
</html>
Separating Container from Content
LESS does MORE
preprocessor
.less file(s)
.css file
client server
<link rel="stylesheet" type="text/css" href="/css/demo2.css">
<aside class="sidemenu">
<h2 class="menu-header">Side menu</h2>
<ul class="menu-list">
<li class=“menu-list-item">
<a class="" href="page1.html">item 1</a>
</li>
<li class=“menu-list-item">
<a class="" href="page2.html">item 1</a>
</li>
</ul>
</aside>
<link rel="stylesheet" type="text/css" href="/css/demo2.css">
<aside id="sidemenu">
<h2>Side menu</h2>
<ul>
<li>
<a href="page1.html">item 1</a>
</li>
<li>
<a href="page2.html">item 1</a>
</li>
</ul>
</aside>
#sidemenu h2{
color: black;
font-size: 16px;
}
#sidemenu ul li a{
text-decoration: none;
color: green;
}
.sidemenu .menu-header{
color: black;
font-size: 16px;
}
.sidemenu .menu-link{
text-decoration: none;
color: green;
}
.sidemenu .menu-header{
color: black;
font-size: 16px;
}
.sidemenu .menu-link{
text-decoration: none;
color: green;
}
.sidemenu{
.menu-header{
color: black;
font-size: 16px;
}
.menu-link{
text-decoration: none;
color: green;
}
}
Nesting
.sidemenu{
.menu-header{
color: black;
font-size: 16px;
}
.menu-link{
text-decoration: none;
color: green;
}
}
@menu-header-color : black;
@menu-link-color : green;
@menu-font-size : 16px;
.sidemenu{
.menu-header{
color: @menu-header-color;
font-size: @menu-font-size;
}
.menu-link{
text-decoration: none;
color: @menu-link-color;
}
}
.sidemenu .menu-header {
color: #000000;
font-size: 16px;
}
.sidemenu .menu-link {
text-decoration: none;
color: #008000;
}
Variables
Calculations
@menu-header-color : black;
@menu-link-color : green;
@menu-font-size : 16px;
@delta-font-size : @menu-font-size / 4;
.sidemenu{
.menu-header{
color: @menu-header-color;
font-size: @menu-font-size;
}
.menu-link{
text-decoration: none;
color: @menu-link-color;
font-size: @menu-font-size - @delta-font-size;
}
}
@menu-header-color : black;
@menu-link-color : green;
@menu-font-size : 16px;
.sidemenu{
.menu-header{
color: @menu-header-color;
font-size: @menu-font-size;
}
.menu-link{
text-decoration: none;
color: @menu-link-color;
}
}
@menu-header-color : black;
@menu-link-color : green;
@menu-font-size : 16px;
.sidemenu{
.menu-header{
color: @menu-header-color;
font-size: @menu-font-size;
}
.menu-link{
text-decoration: none;
color: @menu-link-color;
font-size: 12px;
}
}
.sidemenu .menu-header {
color: #000000;
font-size: 16px;
}
.sidemenu .menu-link {
text-decoration: none;
color: #008000;
font-size: 12px;
}
Built-ins
@menu-header-color : black;
@menu-link-color : green;
@menu-font-size : 16px;
@delta-font-size : @menu-font-size / 4;
.sidemenu{
.menu-header{
color: @menu-header-color;
font-size: @menu-font-size;
}
.menu-link{
text-decoration: none;
color: @menu-link-color;
font-size: @menu-font-size - @delta-font-size;
}
}
.sidemenu {
background-color: #404040;
}
.sidemenu .menu-header {
color: #008000;
font-size: 16px;
}
.sidemenu .menu-link {
text-decoration: none;
color: #00e600;
font-size: 12px;
}
.sidemenu ul {
color: #00e600;
}
@menu-header-color : green;
@menu-link-color : lighten(@menu-header-color, 20%);
@menu-font-size : 16px;
@delta-font-size : @menu-font-size / 4;
.sidemenu{
background-color : greyscale(@menu-header-color,@menu-link-color);
.menu-header{
color: @menu-header-color;
font-size: @menu-font-size;
}
.menu-link{
text-decoration: none;
color: @menu-link-color;
font-size: @menu-font-size - @delta-font-size;
}
ul{
color: @menu-link-color;
}
}
Mixins
.roundedcorners{
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
}
.roundedcorners( @rad : 10px ){
-webkit-border-radius: @rad;
-moz-border-radius: @rad;
border-radius: @rad;
}
@menu-header-color : green;
@menu-link-color : lighten(@menu-header-color, 20%);
@menu-font-size : 16px;
@delta-font-size : @menu-font-size / 4;
.roundedcorners( @rad : 10px ){
-webkit-border-radius: @rad;
-moz-border-radius: @rad;
border-radius: @rad;
}
.sidemenu{
background-color : greyscale(@menu-header-color,@menu-link-color);
.roundedcorners( 25px );
.menu-header{
color: @menu-header-color;
font-size: @menu-font-size;
}
.menu-link{
text-decoration: none;
color: @menu-link-color;
font-size: @menu-font-size - @delta-font-size;
}
ul{
color: @menu-link-color;
}
}
.sidemenu{
background-color : greyscale(@menu-header-color,@menu-link-color);
.roundedcorners( 25px );
.menu-header{
color: @menu-header-color;
font-size: @menu-font-size;
}
.menu-link{
text-decoration: none;
color: @menu-link-color;
font-size: @menu-font-size - @delta-font-size;
}
ul{
color: @menu-link-color;
}
}
Use Building Blocks
Use Building Blocks
Other People’s
http://cl.ly/image/2S0k1q3Q2y2L
Copyright © 2014 APEX Consulting
Q& Aroel@apexconsulting.nl
http://www.apexconsulting.nl
36
roel@apexconsulting.nl
http://www.apexconsulting.nl
Copyright © 2014 APEX Consulting
37

More Related Content

Viewers also liked

My Top 5 APEX JavaScript API's
My Top 5 APEX JavaScript API'sMy Top 5 APEX JavaScript API's
My Top 5 APEX JavaScript API'sRoel Hartman
 
Mastering universal theme
Mastering universal themeMastering universal theme
Mastering universal themeRoel Hartman
 
Ten Tiny Things To Try Today - Hidden APEX5 Gems Revealed
Ten Tiny Things To Try Today - Hidden APEX5 Gems RevealedTen Tiny Things To Try Today - Hidden APEX5 Gems Revealed
Ten Tiny Things To Try Today - Hidden APEX5 Gems RevealedRoel Hartman
 
WebXpress 3PL Management
WebXpress 3PL ManagementWebXpress 3PL Management
WebXpress 3PL ManagementWebXpress.IN
 
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...Roel Hartman
 
Best of both worlds: Create hybrid mobile applications with Oracle Applicatio...
Best of both worlds: Create hybrid mobile applications with Oracle Applicatio...Best of both worlds: Create hybrid mobile applications with Oracle Applicatio...
Best of both worlds: Create hybrid mobile applications with Oracle Applicatio...Roel Hartman
 
APEX printing with BI Publisher
APEX printing with BI PublisherAPEX printing with BI Publisher
APEX printing with BI PublisherRoel Hartman
 
Oracle - SQL-PL/SQL context switching
Oracle - SQL-PL/SQL context switchingOracle - SQL-PL/SQL context switching
Oracle - SQL-PL/SQL context switchingSmitha Padmanabhan
 
LOBS, BLOBS, CLOBS: Dealing with Attachments in APEX
LOBS, BLOBS, CLOBS: Dealing with Attachments in APEXLOBS, BLOBS, CLOBS: Dealing with Attachments in APEX
LOBS, BLOBS, CLOBS: Dealing with Attachments in APEXEnkitec
 
The Amazing and Elegant PL/SQL Function Result Cache
The Amazing and Elegant PL/SQL Function Result CacheThe Amazing and Elegant PL/SQL Function Result Cache
The Amazing and Elegant PL/SQL Function Result CacheSteven Feuerstein
 
PLSQL Standards and Best Practices
PLSQL Standards and Best PracticesPLSQL Standards and Best Practices
PLSQL Standards and Best PracticesAlwyn D'Souza
 
Generic collection types in PLSQL
Generic collection types in PLSQLGeneric collection types in PLSQL
Generic collection types in PLSQLArnold Reuser
 
Striving for Perfection: The Ultimate APEX Application Architecture
Striving for Perfection: The Ultimate APEX Application ArchitectureStriving for Perfection: The Ultimate APEX Application Architecture
Striving for Perfection: The Ultimate APEX Application ArchitectureRoel Hartman
 
Oracle Text in APEX
Oracle Text in APEXOracle Text in APEX
Oracle Text in APEXScott Wesley
 
Oracle SQL, PL/SQL Performance tuning
Oracle SQL, PL/SQL Performance tuningOracle SQL, PL/SQL Performance tuning
Oracle SQL, PL/SQL Performance tuningSmitha Padmanabhan
 
Oracle PL/SQL exception handling
Oracle PL/SQL exception handlingOracle PL/SQL exception handling
Oracle PL/SQL exception handlingSmitha Padmanabhan
 
utPLSQL: Unit Testing for Oracle PL/SQL
utPLSQL: Unit Testing for Oracle PL/SQLutPLSQL: Unit Testing for Oracle PL/SQL
utPLSQL: Unit Testing for Oracle PL/SQLSteven Feuerstein
 
Oracle APEX Performance
Oracle APEX PerformanceOracle APEX Performance
Oracle APEX PerformanceScott Wesley
 

Viewers also liked (20)

My Top 5 APEX JavaScript API's
My Top 5 APEX JavaScript API'sMy Top 5 APEX JavaScript API's
My Top 5 APEX JavaScript API's
 
Mastering universal theme
Mastering universal themeMastering universal theme
Mastering universal theme
 
Ten Tiny Things To Try Today - Hidden APEX5 Gems Revealed
Ten Tiny Things To Try Today - Hidden APEX5 Gems RevealedTen Tiny Things To Try Today - Hidden APEX5 Gems Revealed
Ten Tiny Things To Try Today - Hidden APEX5 Gems Revealed
 
WebXpress 3PL Management
WebXpress 3PL ManagementWebXpress 3PL Management
WebXpress 3PL Management
 
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...Developing A Real World Logistic Application With Oracle Application - UKOUG ...
Developing A Real World Logistic Application With Oracle Application - UKOUG ...
 
Best of both worlds: Create hybrid mobile applications with Oracle Applicatio...
Best of both worlds: Create hybrid mobile applications with Oracle Applicatio...Best of both worlds: Create hybrid mobile applications with Oracle Applicatio...
Best of both worlds: Create hybrid mobile applications with Oracle Applicatio...
 
APEX printing with BI Publisher
APEX printing with BI PublisherAPEX printing with BI Publisher
APEX printing with BI Publisher
 
AMIS - Can collections speed up your PL/SQL?
AMIS - Can collections speed up your PL/SQL?AMIS - Can collections speed up your PL/SQL?
AMIS - Can collections speed up your PL/SQL?
 
Oracle query optimizer
Oracle query optimizerOracle query optimizer
Oracle query optimizer
 
Oracle - SQL-PL/SQL context switching
Oracle - SQL-PL/SQL context switchingOracle - SQL-PL/SQL context switching
Oracle - SQL-PL/SQL context switching
 
LOBS, BLOBS, CLOBS: Dealing with Attachments in APEX
LOBS, BLOBS, CLOBS: Dealing with Attachments in APEXLOBS, BLOBS, CLOBS: Dealing with Attachments in APEX
LOBS, BLOBS, CLOBS: Dealing with Attachments in APEX
 
The Amazing and Elegant PL/SQL Function Result Cache
The Amazing and Elegant PL/SQL Function Result CacheThe Amazing and Elegant PL/SQL Function Result Cache
The Amazing and Elegant PL/SQL Function Result Cache
 
PLSQL Standards and Best Practices
PLSQL Standards and Best PracticesPLSQL Standards and Best Practices
PLSQL Standards and Best Practices
 
Generic collection types in PLSQL
Generic collection types in PLSQLGeneric collection types in PLSQL
Generic collection types in PLSQL
 
Striving for Perfection: The Ultimate APEX Application Architecture
Striving for Perfection: The Ultimate APEX Application ArchitectureStriving for Perfection: The Ultimate APEX Application Architecture
Striving for Perfection: The Ultimate APEX Application Architecture
 
Oracle Text in APEX
Oracle Text in APEXOracle Text in APEX
Oracle Text in APEX
 
Oracle SQL, PL/SQL Performance tuning
Oracle SQL, PL/SQL Performance tuningOracle SQL, PL/SQL Performance tuning
Oracle SQL, PL/SQL Performance tuning
 
Oracle PL/SQL exception handling
Oracle PL/SQL exception handlingOracle PL/SQL exception handling
Oracle PL/SQL exception handling
 
utPLSQL: Unit Testing for Oracle PL/SQL
utPLSQL: Unit Testing for Oracle PL/SQLutPLSQL: Unit Testing for Oracle PL/SQL
utPLSQL: Unit Testing for Oracle PL/SQL
 
Oracle APEX Performance
Oracle APEX PerformanceOracle APEX Performance
Oracle APEX Performance
 

More from Roel Hartman

APEX Bad Practices
APEX Bad PracticesAPEX Bad Practices
APEX Bad PracticesRoel Hartman
 
Tweaking the interactive grid
Tweaking the interactive gridTweaking the interactive grid
Tweaking the interactive gridRoel Hartman
 
Docker for Dummies
Docker for DummiesDocker for Dummies
Docker for DummiesRoel Hartman
 
A deep dive into APEX JET charts
A deep dive into APEX JET chartsA deep dive into APEX JET charts
A deep dive into APEX JET chartsRoel Hartman
 
5 Cool Things you can do with HTML5 and APEX
5 Cool Things you can do with HTML5 and APEX5 Cool Things you can do with HTML5 and APEX
5 Cool Things you can do with HTML5 and APEXRoel Hartman
 
XFILES, the APEX 4 version - The truth is in there
XFILES, the APEX 4 version - The truth is in thereXFILES, the APEX 4 version - The truth is in there
XFILES, the APEX 4 version - The truth is in thereRoel Hartman
 
Done in 60 seconds - Creating Web 2.0 applications made easy
Done in 60 seconds - Creating Web 2.0 applications made easyDone in 60 seconds - Creating Web 2.0 applications made easy
Done in 60 seconds - Creating Web 2.0 applications made easyRoel Hartman
 
Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefiniti...
Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefiniti...Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefiniti...
Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefiniti...Roel Hartman
 
Creating sub zero dashboard plugin for apex with google
Creating sub zero dashboard plugin for apex with googleCreating sub zero dashboard plugin for apex with google
Creating sub zero dashboard plugin for apex with googleRoel Hartman
 
Integration of APEX and Oracle Forms
Integration of APEX and Oracle FormsIntegration of APEX and Oracle Forms
Integration of APEX and Oracle FormsRoel Hartman
 

More from Roel Hartman (11)

Wizard of ORDS
Wizard of ORDSWizard of ORDS
Wizard of ORDS
 
APEX Bad Practices
APEX Bad PracticesAPEX Bad Practices
APEX Bad Practices
 
Tweaking the interactive grid
Tweaking the interactive gridTweaking the interactive grid
Tweaking the interactive grid
 
Docker for Dummies
Docker for DummiesDocker for Dummies
Docker for Dummies
 
A deep dive into APEX JET charts
A deep dive into APEX JET chartsA deep dive into APEX JET charts
A deep dive into APEX JET charts
 
5 Cool Things you can do with HTML5 and APEX
5 Cool Things you can do with HTML5 and APEX5 Cool Things you can do with HTML5 and APEX
5 Cool Things you can do with HTML5 and APEX
 
XFILES, the APEX 4 version - The truth is in there
XFILES, the APEX 4 version - The truth is in thereXFILES, the APEX 4 version - The truth is in there
XFILES, the APEX 4 version - The truth is in there
 
Done in 60 seconds - Creating Web 2.0 applications made easy
Done in 60 seconds - Creating Web 2.0 applications made easyDone in 60 seconds - Creating Web 2.0 applications made easy
Done in 60 seconds - Creating Web 2.0 applications made easy
 
Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefiniti...
Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefiniti...Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefiniti...
Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefiniti...
 
Creating sub zero dashboard plugin for apex with google
Creating sub zero dashboard plugin for apex with googleCreating sub zero dashboard plugin for apex with google
Creating sub zero dashboard plugin for apex with google
 
Integration of APEX and Oracle Forms
Integration of APEX and Oracle FormsIntegration of APEX and Oracle Forms
Integration of APEX and Oracle Forms
 

APEX Developers : Do More With LESS !

  • 1. Copyright © 2014 APEX Consulting APEX Developers - Do More With Less !! Roel Hartman
  • 2. 2
  • 11. You need a CSS Expert Issue 1
  • 12. Your CSS File(s) grows Issue 2
  • 13. No CSS code re-use Issue 3
  • 15. CSS increases 1:1 with HTML Result
  • 18. #button { width: 200px; height: 50px; padding: 10px; border: solid 1px #ccc; background: linear-gradient(#ccc, #222); box-shadow: rgba(0, 0, 0, .5) 2px 2px 5px; } #box { width: 400px; overflow: hidden; border: solid 1px #ccc; background: linear-gradient(#ccc, #222); box-shadow: rgba(0, 0, 0, .5) 2px 2px 5px; } #widget { width: 500px; min-height: 200px; overflow: auto; border: solid 1px #ccc; background: linear-gradient(#ccc, #222); box-shadow: rgba(0, 0, 0, .5) 2px 2px 5px; } <html> <div id=“box”> <button id=“button” /> </div> <div id=“widget”></div> </html> #button { width: 200px; height: 50px; padding: 10px; border: solid 1px #ccc; background: linear-gradient(#ccc, #222); box-shadow: rgba(0, 0, 0, .5) 2px 2px 5px; } #box { width: 400px; overflow: hidden; border: solid 1px #ccc; background: linear-gradient(#ccc, #222); box-shadow: rgba(0, 0, 0, .5) 2px 2px 5px; } #widget { width: 500px; min-height: 200px; overflow: auto; border: solid 1px #ccc; background: linear-gradient(#ccc, #222); box-shadow: rgba(0, 0, 0, .5) 2px 2px 5px; }
  • 19. #button { width: 200px; height: 50px; padding: 10px; border: solid 1px #ccc; background: linear-gradient(#ccc, #222); box-shadow: rgba(0, 0, 0, .5) 2px 2px 5px; } #box { width: 400px; overflow: hidden; border: solid 1px #ccc; background: linear-gradient(#ccc, #222); box-shadow: rgba(0, 0, 0, .5) 2px 2px 5px; } #widget { width: 500px; min-height: 200px; overflow: auto; border: solid 1px #ccc; background: linear-gradient(#ccc, #222); box-shadow: rgba(0, 0, 0, .5) 2px 2px 5px; } .button { width: 200px; height: 50px; } .box { width: 400px; overflow: hidden; } .widget { width: 500px; min-height: 200px; overflow: auto; } .skin { border: solid 1px #ccc; background: linear-gradient(#ccc, #222); box-shadow: rgba(0, 0, 0, .5) 2px 2px 5px; }
  • 20. .button { width: 200px; height: 50px; } .box { width: 400px; overflow: hidden; } .widget { width: 500px; min-height: 200px; overflow: auto; } .skin { border: solid 1px #ccc; background: linear-gradient(#ccc, #222); box-shadow: rgba(0, 0, 0, .5) 2px 2px 5px; } <html> <div class=“box skin”> <button id=“button skin” /> </div> <div id=“widget skin”></div> </html>
  • 23. div{ width: 200px; height: 50px; padding: 10px; border: solid 1px #ccc; } div h3{ margin: 0px; overflow: hidden; border: solid 1px #ccc; } div p{ margin: 3px; min-height: 200px; overflow: auto; border: solid 1px #ccc; } <html> <div> <h3>Header</h3> </div> <div> <p>Paragraph</p> </div> </html>
  • 24. .bordered{ border: solid 1px #ccc; } .container{ width: 200px; height: 50px; padding: 10px; } .region-header{ margin: 0px; overflow: hidden; } .flexbox{ margin: 3px; min-height: 200px; overflow: auto; } <html> <div class=“bordered container”> <h3 class=“bordered region-header”> Header </h3> </div> <div class=“bordered container”> <p class=“bordered flexbox”>Paragraph</p> </div> </html>
  • 28. <link rel="stylesheet" type="text/css" href="/css/demo2.css"> <aside class="sidemenu"> <h2 class="menu-header">Side menu</h2> <ul class="menu-list"> <li class=“menu-list-item"> <a class="" href="page1.html">item 1</a> </li> <li class=“menu-list-item"> <a class="" href="page2.html">item 1</a> </li> </ul> </aside> <link rel="stylesheet" type="text/css" href="/css/demo2.css"> <aside id="sidemenu"> <h2>Side menu</h2> <ul> <li> <a href="page1.html">item 1</a> </li> <li> <a href="page2.html">item 1</a> </li> </ul> </aside> #sidemenu h2{ color: black; font-size: 16px; } #sidemenu ul li a{ text-decoration: none; color: green; } .sidemenu .menu-header{ color: black; font-size: 16px; } .sidemenu .menu-link{ text-decoration: none; color: green; }
  • 29. .sidemenu .menu-header{ color: black; font-size: 16px; } .sidemenu .menu-link{ text-decoration: none; color: green; } .sidemenu{ .menu-header{ color: black; font-size: 16px; } .menu-link{ text-decoration: none; color: green; } } Nesting
  • 30. .sidemenu{ .menu-header{ color: black; font-size: 16px; } .menu-link{ text-decoration: none; color: green; } } @menu-header-color : black; @menu-link-color : green; @menu-font-size : 16px; .sidemenu{ .menu-header{ color: @menu-header-color; font-size: @menu-font-size; } .menu-link{ text-decoration: none; color: @menu-link-color; } } .sidemenu .menu-header { color: #000000; font-size: 16px; } .sidemenu .menu-link { text-decoration: none; color: #008000; } Variables
  • 31. Calculations @menu-header-color : black; @menu-link-color : green; @menu-font-size : 16px; @delta-font-size : @menu-font-size / 4; .sidemenu{ .menu-header{ color: @menu-header-color; font-size: @menu-font-size; } .menu-link{ text-decoration: none; color: @menu-link-color; font-size: @menu-font-size - @delta-font-size; } } @menu-header-color : black; @menu-link-color : green; @menu-font-size : 16px; .sidemenu{ .menu-header{ color: @menu-header-color; font-size: @menu-font-size; } .menu-link{ text-decoration: none; color: @menu-link-color; } } @menu-header-color : black; @menu-link-color : green; @menu-font-size : 16px; .sidemenu{ .menu-header{ color: @menu-header-color; font-size: @menu-font-size; } .menu-link{ text-decoration: none; color: @menu-link-color; font-size: 12px; } } .sidemenu .menu-header { color: #000000; font-size: 16px; } .sidemenu .menu-link { text-decoration: none; color: #008000; font-size: 12px; }
  • 32. Built-ins @menu-header-color : black; @menu-link-color : green; @menu-font-size : 16px; @delta-font-size : @menu-font-size / 4; .sidemenu{ .menu-header{ color: @menu-header-color; font-size: @menu-font-size; } .menu-link{ text-decoration: none; color: @menu-link-color; font-size: @menu-font-size - @delta-font-size; } } .sidemenu { background-color: #404040; } .sidemenu .menu-header { color: #008000; font-size: 16px; } .sidemenu .menu-link { text-decoration: none; color: #00e600; font-size: 12px; } .sidemenu ul { color: #00e600; } @menu-header-color : green; @menu-link-color : lighten(@menu-header-color, 20%); @menu-font-size : 16px; @delta-font-size : @menu-font-size / 4; .sidemenu{ background-color : greyscale(@menu-header-color,@menu-link-color); .menu-header{ color: @menu-header-color; font-size: @menu-font-size; } .menu-link{ text-decoration: none; color: @menu-link-color; font-size: @menu-font-size - @delta-font-size; } ul{ color: @menu-link-color; } }
  • 33. Mixins .roundedcorners{ -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; } .roundedcorners( @rad : 10px ){ -webkit-border-radius: @rad; -moz-border-radius: @rad; border-radius: @rad; }
  • 34. @menu-header-color : green; @menu-link-color : lighten(@menu-header-color, 20%); @menu-font-size : 16px; @delta-font-size : @menu-font-size / 4; .roundedcorners( @rad : 10px ){ -webkit-border-radius: @rad; -moz-border-radius: @rad; border-radius: @rad; } .sidemenu{ background-color : greyscale(@menu-header-color,@menu-link-color); .roundedcorners( 25px ); .menu-header{ color: @menu-header-color; font-size: @menu-font-size; } .menu-link{ text-decoration: none; color: @menu-link-color; font-size: @menu-font-size - @delta-font-size; } ul{ color: @menu-link-color; } } .sidemenu{ background-color : greyscale(@menu-header-color,@menu-link-color); .roundedcorners( 25px ); .menu-header{ color: @menu-header-color; font-size: @menu-font-size; } .menu-link{ text-decoration: none; color: @menu-link-color; font-size: @menu-font-size - @delta-font-size; } ul{ color: @menu-link-color; } } Use Building Blocks
  • 35. Use Building Blocks Other People’s http://cl.ly/image/2S0k1q3Q2y2L
  • 36. Copyright © 2014 APEX Consulting Q& Aroel@apexconsulting.nl http://www.apexconsulting.nl 36