Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Give CSS3 Some Love / FOWD2015
Search
Dan Cork
November 04, 2015
Technology
290
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Give CSS3 Some Love / FOWD2015
Give CSS3 Some Love
Future of Web Design 2015 - Rising Stars
Dan Cork
November 04, 2015
More Decks by Dan Cork
See All by Dan Cork
Paradox of Choice
dancork
0
44
Unify The UI With React
dancork
0
260
Talking Tech Jan 2016
dancork
0
70
Git For Humans - Holiday Extras - 14/08/2015
dancork
0
250
Other Decks in Technology
See All in Technology
AIペネトレーションテスト・ セキュリティ検証「AgenticSec」紹介資料
laysakura
2
7.8k
AWS PrivateLink × SCIM で実現する セキュアで運⽤負荷の低い Databricks 基盤の構築
tsuda7
0
120
初めてのDatabricks勉強会
taka_aki
2
220
秘密度ラベル初心者が第1歩でつまづかないための「設計・運用」ポイント
seafay
PRO
1
540
次世代ランサムウェア対策の考察 / 20260704 Mitsutoshi Matsuo
shift_evolve
PRO
5
1.5k
背中から、背中へ /paying forward to community
naitosatoshi
0
190
“全部コピーしない”ファイルデータの活用 : — FSx for ONTAP × S3 Tables × Icebergで作るメタデータカタログ
yoshiki0705
0
120
アラート調査向けAIエージェントの本番導入とその後/AI Agents for Alert Investigation: Production Deployment and After
taddy_919
1
300
SRE歴2ヶ月でも開発6年の知見を活かして、チームで止まっていた環境改善を前に進めた話
a_ono
0
160
認証認可だけじゃない! ID管理の構成要素と ライフサイクルを意識しよう
ritou
1
410
AWS Security Hub CSPMの成功・失敗体験
cmusudakeisuke
0
620
IaC コードを資産へ:AWS CDK 社内ライブラリと横断展開 / aws-summit-japan-2026
gotok365
10
1.7k
Featured
See All Featured
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
180
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
210
Building Applications with DynamoDB
mza
96
7.1k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
440
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Ruling the World: When Life Gets Gamed
codingconduct
0
270
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.6k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
56k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
300
Crafting Experiences
bethany
1
190
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
600
Transcript
Give CSS3 Some Love
Because CSS4 Is Coming!
Disclaimer:
CSS4 Isn’t A Thing
CSS Level 4 W orking Drafts
CSS2.1 Last Major Version
CSS Level 4 = CSS3 = CSS
Confusing Much?
What Am I Going T o T alk About
CSS3 Usage
How We Can Improve IT
What’s Coming Soon
@dancork
Holiday Extras
What’s The Problem
CSS3 Usage is Poor
T op 1 Million Websites http://trends.builtwith.com/css
Max Width 270,538
Max Width 27%
Min Width 209,608
Min Width 21%
Media Queries 48%
Chrome Anonymous Stats https://www .chromestatus.com/metrics/css/popularity
transform 42.5%
box-sizing 74.5%
T oo often the web interface ends up being the
lowest common denominator Henrik Joreteg
Engineering a UI is complex
little control over the environment
Does the ux NEED to be the same?
Who uses multiple browsers?
elephant in the room
None
http://caniuse.com/usage_table.php
IE8 1.38%
>98% support CSS3
CSS is unique
Passes over unknown properties
Less than half of web is responsive! IE is dying
CSS is your friend CSS3 usage is poor
What Can Be Done?
Avoid vendor prefixes
border-radius: 5px;
-webkit-border-radius: 5px; -moz-border-radius: 5px; -ms-border-radius: 5px; -o-border-radius: 5px; border-radius: 5px;
Will become outdated
technical debt
T ool up with Autoprefixer postcss/autoprefixer
W rite pure css
W orks with LESS and SASS
CLI, GRUNT , GULP or WEBP ACK
Minimises T echnical Debt
Media queries
None
None
Mobile first?
Majority of mobile browsers support queries
FOCUS ON JOBS, THEN SCREENS, BUT NEVER DEVICES https://blog.intercom.io/why-mobile-first-may-already-be-outdated/ Paul
Adams
Box Sizing
Old box model was stupid
Especially when building a grid
Border Box
Feb 1 International Box Sizing Awareness Day
https://css- tricks.com/ international-box- sizing-awareness- day/
OMG! It works in IE8
html { box-sizing: border-box; } *, *:before, *:after { box-sizing:
inherit; }
T ransform
T op/Left vs T ranslate
Positioning T op/Left
UI animation T ranslate
top/left has large paint time
3D transforms hardware accelerated
a { transform: translate3d(0,0,0); } a { transform: scale3d(1,1,1); }
a { transform: translateZ(0); } a { transform: scaleZ(1); }
no jank
not everything is accelerated
transform:translate transform:scale transform:rotate opacity
but you can do a lot with those!
Scale & Mouse events
Making Material Design https://www .youtube.com/watch?v=rrT6v5sOwJg
None
None
High Performance Animation http://www .html5rocks.com/en/tutorials/speed/high-performance-animations/
csstriggers. com
Vendor prefixes are stupid Go responsive, consider default Border-box all
the things T ransform for UI Animation
The New Stuff
Feature Queries
@supports
@supports (display:flex) { section { display: flex } }
@supports (column-width: 20rem) and (column-span: all) { div { column-width:
20rem } div h2 { column-span: all } }
Limited Support?
JavaScript API
CSS.supports()
Polyfill
Media Queries
light-level
dim normal washed
@media (light-level: dim) { .app { background: black; color: white;
} } @media (light-level: washed) { .app { background: white; color: black; } }
hover
none on-demand hover
.element .tooltip { /* hide tooltip */ } @media (hover)
{ .element .inline-tooltip { /* hide inline tooltip */ } .element:hover .tooltip { /* show tooltip */ } }
pointer
none coarse fine
.link { padding 1em; } @media (pointer:fine) { .link {
padding: 0.25em; } }
any-hover any-pointer
pointer hover none hover course fine smartphones, touch screens stylus-based
screens mouse, touch pad Nintendo Wii, Kinect
custom media queries
@custom-media --small (max-width: 520px); @media (--small) { /* styles for
small viewport */ }
PostCSS postcss/postcss-custom-media
ranges
@media (min-width: 600px) and (max-width: 1000px) {}
@media (width > 600px) and (width < 1000px) {}
@media (600px < width < 1000px) {}
PostCSS postcss/postcss-media-minmax
Relational :has()
div:has(p){ background: #FF0000; }
Change CSS based on content
TO-DO
<div class=“todo”> <input /> <ul> </ul> </div>
<div class=“todo”> <input /> <ul class=“empty”> </ul> </div>
<div class=“todo”> <input /> <ul style=“display:none;”> </ul> </div>
.todo ul { display:none; } .todo ul:has(li) { display:block; }
.todo ul:not(:has(li)) { display:none; }
Ordering is important
.todo ul:not(:has(li)) { display:none; }
.todo ul:has(:not(li)) { display:none; }
Browser support is limited
It’s non existent
We can try it
Polyfill.js philipwalton/polyfill
Polyfill({selectors: [“:has"]}) .doMatched(function (rules) { rules.each(function (rule) { $(rule.getSelectors()) .css(rule.getDeclaration());
}); });
Feature queries removes reliance on JavaScript :has() is too awesome!!!
New media queries, understand the environment better
last decade's "pretty good” is today’s "a bit shit" Jake
Archibald
Thank Y ou TWITTER: @DANCORK SLIDES: SPEAKERDECK.COM/DANCORK/FOWD2015