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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Ngalam Backend Community
June 26, 2020
Technology
59
0
Share
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
88
Introduction to Flask
ngalambackend
0
190
Achieving API Performance and Scalability
ngalambackend
0
93
Interfaces in Go
ngalambackend
0
64
Productive Remote Working with Scrum
ngalambackend
0
100
Covid Tracker Kota Malang
ngalambackend
0
74
Supercharge Local Development with Docker
ngalambackend
1
130
Building Scalable and Flexible API by Leveraging GraphQL and BigTable
ngalambackend
1
330
Software 2.0 With Go
ngalambackend
1
66
Other Decks in Technology
See All in Technology
Oracle AI Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
6
1.5k
組織の中で自分を経営する技術
shoota
0
230
A Harness for Behaviour: how to get AI to generate code that does what we intend, or "TDD in the age of AI"
xpmatteo
1
520
ポスター発表&デモと総括 / Poster Presentations & Demonstrations and Summary
ks91
PRO
0
180
Gradle×GitHub_ActionsでCI時間を約50%短縮 ジョブ分割の設計と落とし穴 / Cutting CI Time by ~50% with Gradle and GitHub Actions: Job-Splitting Design and Pitfalls
takatty
0
550
エンジニアは生成AIと どのように向き合うべきか? ことばの意味という観点から
verypluming
3
310
AIが変えた"品質の守り方"
kkakizaki
13
5.5k
Dynamic Workersについて
yusukebe
2
540
Javaで学ぶSOLID原則
negima
1
250
20260528_生成AIを専属DSに_Howの次にすべきことを考える
doradora09
PRO
0
270
テストコードのないプロジェクトにテストを根付かせる
tttol
1
240
Agentic AI時代における メルカリのAIガバナンスとガードレール実装
naoichihara
17
17k
Featured
See All Featured
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
160
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
70
39k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
390
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.1k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.6k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
61
44k
Building the Perfect Custom Keyboard
takai
2
780
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
520
Making the Leap to Tech Lead
cromwellryan
135
9.9k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
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