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
CSS in JS in action
Search
Ngalam Backend Community
June 26, 2020
Technology
62
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
CSS in JS in action
CSS in JS in action - Fahmi Idris - Frontend Engineer at Kata.ai
Ngalam Backend Community
June 26, 2020
More Decks by Ngalam Backend Community
See All by Ngalam Backend Community
Web_Scraping_with_Scrapy.pdf
ngalambackend
0
90
Introduction to Flask
ngalambackend
0
200
Achieving API Performance and Scalability
ngalambackend
0
97
Interfaces in Go
ngalambackend
0
68
Productive Remote Working with Scrum
ngalambackend
0
110
Covid Tracker Kota Malang
ngalambackend
0
75
Supercharge Local Development with Docker
ngalambackend
1
140
Building Scalable and Flexible API by Leveraging GraphQL and BigTable
ngalambackend
1
340
Software 2.0 With Go
ngalambackend
1
71
Other Decks in Technology
See All in Technology
最適な自走を最小限の支援で — M&Aで拡大する組織で少人数SREが挑んだ1年 / SRE NEXT 2026
genda
0
1.1k
キャリアの中で本を作る / Making a Book During Your Career
ak1210
0
130
Terraform共通モジュールをチーム横断で“変えられる”運用へ ― リリースと適用の分離
kekke_n
1
2.9k
Amazon EVS で VCF 9.0 / 9.1 のサポート開始まとめ
mtoyoda
0
290
AI Driven AI Governance
pict3
0
340
SRE依存からの脱却 運用を開 発チームへ移す、 フルサイ クル開 発体制の実践
joooee0000
0
2.7k
世界、断片、モデル。そして理解
ardbeg1958
1
110
なぜ私たちのSREプラクティスはなかなか機能しないのか 〜システムより先に組織を見る〜 / Why our SRE practices aren't really working
vtryo
3
3.6k
Keeping applications secure by evolving OAuth 2.0 and OpenID Connect
ahus1
PRO
1
160
脱金融のフューチャー・デザイン / Future Design Beyond Finance
ks91
PRO
0
150
AICoEでAIネイティブ組織への進化
yukiogawa
0
160
DatabricksにおけるMCPソリューション
taka_aki
1
240
Featured
See All Featured
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
260
Art, The Web, and Tiny UX
lynnandtonic
304
22k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
260
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
630
Navigating Weather and Climate Data
rabernat
0
310
Building Adaptive Systems
keathley
44
3.1k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
220
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.1k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
330
Designing for humans not robots
tammielis
254
26k
Transcript
CSS in JS Fahmi Idris - Frontend Engineer
who am i? Fahmi Idris ·
[email protected]
- Frontend Engineer
@ Kata.ai - FIFA Gamer (FIFA Ultimate Team)
what is CSS? • CSS stands for Cascading Style Sheets
• CSS describes how HTML elements are to be displayed
CSS syntax example <style> body { margin: 0; text-align: center;
} h1 { color: blue; font-size: 12px; } p { font-size: 20px; } </style>
CSS preprocessor CSS preprocessor is a program that lets you
generate CSS from the preprocessor's own unique syntax.
CSS preprocessor example
SASS syntax example $font-stack: Helvetica, sans-serif; $primary-color: #333; body {
font: 100% $font-stack; color: $primary-color; ul { margin: 0; padding: 0; list-style: none; } }
CSS in JS “CSS-in-JS” refers to a pattern where CSS
is composed using JavaScript instead of defined in external files.
CSS in JS example
Styled Components utilises tagged template literals to style your components.
It removes the mapping between components and styles.
how it works? • Evaluate the tagged template. • Generate
the new CSS class name. • Preprocess the styles with stylis. • Inject the preprocessed CSS into the page. https://medium.com/styled-components/how-styled-components-works-618a69970421
showcase
example
pros • Local Scoping • Reusability • Dynamic Functionality •
Provides non-CSS features like nesting • No need to think about uniq names for CSS classes
cons • Learning Curve • Extra Layer of Complexity •
Code Readability
CSS in JS list https://github.com/MicheleBertoli/css-in-js
thanks