Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Less is more
Search
Sven Dahlstrand
May 16, 2012
Technology
380
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Less is more
Sven Dahlstrand
May 16, 2012
Transcript
12 slides
is more
CSS Jag
body { background: #5b83ad url("http://assets.example.com/images/background.png"); } .email-icon { background-image: url("http://assets.example.com/images/email.png");
border-color: #5b83ad; } Repetition - jobbigt att ändra Variabler @base-url: "http://assets.example.com/images"; @blue: #5b83ad; body { background: @blue url("@{base-url}/background.png"); } .email-icon { background-image: url("@{base-url}/email.png"); border-color: @blue; }
#information { background-color: #eeeeee; background-image: -webkit-linear-gradient(top, #eeeeee, #ffffff); background-image: -moz-linear-gradient(top,
#eeeeee, #ffffff); background-image: -ms-linear-gradient(top, #eeeeee, #ffffff); background-image: -o-linear-gradient(top, #eeeeee, #ffffff); } Mer repetition - svårt att återanvända .gradient (@from: #eee, @to: #fff) { background-color: @from; background-image: -webkit-linear-gradient(top, @from, @to); background-image: -moz-linear-gradient(top, @from, @to); background-image: -ms-linear-gradient(top, @from, @to); background-image: -o-linear-gradient(top, @from, @to); } #information { .gradient(#5b83ad, #fffff); } Mixins
.tweets { border-left: 2px solid blue; } .tweets ul {
list-style: none; margin: 0; padding: 0; } .tweets a { color: gray; display: block; } .tweets a:hover { color: blue; } Kan bli tydligare .tweets { border-left: 2px solid blue; ul { list-style: none; margin: 0; padding: 0; } a { color: gray; display: block; &:hover { color: blue; } } } Nästling
Allt det här och mer!
㟬Մ爱 WTF?!
i webbläsaren eller på servern LESS måste översättas
Ladda hem från lesscss.org less i stället för css Kom
igång! <link rel="stylesheet/less" type="text/css" href="styles.less"> <script src="less.js" type="text/javascript"></script>
Demo
Mindre repetition Enklare underhåll och återanvändning Inkludera less.js och kör
Sven Dahlstrand @svendahlstrand http://svendahlstrand.se
More Decks by Sven Dahlstrand
See All by Sven Dahlstrand
Ett smörgåsbord av smarta verktyg
svendahlstrand
0
910
Smarta lösningar i SiteVision
svendahlstrand
0
72
46elks
svendahlstrand
0
170
Internet of Things
svendahlstrand
2
120
Responsiv webbdesign
svendahlstrand
1
60
Internet of Things
svendahlstrand
1
190
Att testa dina SiteVision-portlets
svendahlstrand
1
150
Other Decks in Technology
See All in Technology
Is the Website Dying?
miriamschwab
0
160
20261119_AgentCore
takuyay0ne
2
280
Welcome JXL!
dynamis
0
120
SBOM 生成ツールで 2026 Minimum Elements はどこまで満たせるのか
gokken
0
160
閉域網でのAPI公開の選択肢全部比較!
takano0131
5
700
AWS Client VPNの設定でハマったポイントとその過程での気づき
amarelo_n24
1
440
kubellの最新データ分析環境
kubell_hr
2
260
新規事業開発でのAWS活用成功談&失敗談! 〜新規事業開発を専門に行うRelicならではのAWS活用〜
amixedcolor
1
140
データから見る AI時代のエンジニア転職と採用
junya_okura
4
1.3k
Taking back control of your AI development
inesmontani
PRO
0
310
認知の質も文化醸成も。数年取り組んで見えてきた技術広報のKPI設計 / Tech PR KPIs: Lessons on Awareness Quality and Culture After Several Years
bitkey
PRO
0
210
業務の傍らで進める改善ループエンジニアリング
bengo4com
1
240
Featured
See All Featured
New Earth Scene 8
popppiees
5
2.9k
Raft: Consensus for Rubyists
vanstee
143
7.9k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Heart Work Chapter 1 - Part 1
lfama
PRO
11
37k
Are puppies a ranking factor?
jonoalderson
2
4.2k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.7k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.5k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
440
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
1
250
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
620
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
1k