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のclip-pathの紹介
Search
Yohei Iino
March 01, 2022
Design
0
420
CSSのclip-pathの紹介
Yohei Iino
March 01, 2022
Tweet
Share
More Decks by Yohei Iino
See All by Yohei Iino
T3 Stack(応用編: Next Auth & SSRの実装紹介)
wheatandcat
1
34
App Routerの紹介
wheatandcat
0
18
Flutter × GraphQLでアプリを作ってみる
wheatandcat
0
46
T3 Stack + Supabaseでアプリを作ってみる
wheatandcat
0
88
Supabaseの紹介
wheatandcat
0
90
tRPCの紹介
wheatandcat
0
73
Plasmoの紹介
wheatandcat
0
48
Playwrightの紹介
wheatandcat
0
120
Vitestの紹介
wheatandcat
1
82
Other Decks in Design
See All in Design
デザイナーの帽子をかぶったわたしが、プロダクト開発するうえでスクラムチームに提供したいこと / what I want to provide to Scrum teams when developing products
hiromitsuuuuu
14
4.9k
20231122_Design Leader Impact Award_Presentation_FAKE Okazaki
okazakityo
1
250
MiKS inc. Company PR en_202404
zakkerooni
0
160
Product-Writing
aguringo
6
2.8k
デザインをみんなのものに 「デザインの脱植民地化」を日本の文脈で考える
mayunak
7
4.1k
The Fight
euralisw
0
110
デザインを誘発する「イネーブルメント」アプローチ #spectrumfest2023 / 20231203
minamitary
0
580
IPの世界観に寄り添う、マルチブランドなカラーシステム設計
jirosh1998
0
2.9k
Jeremy's First Day
myates3
1
130
他人事じゃないWebアクセシビリティ入門
arihiro17
0
210
ゲームクリエイター、事業会社のデザイナーになる
satomium1
0
180
Ride or Die Animatics
warwatkar
0
140
Featured
See All Featured
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
104
6.6k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
226
51k
Docker and Python
trallard
34
2.7k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
7
1k
Documentation Writing (for coders)
carmenintech
60
3.9k
Building Your Own Lightsaber
phodgson
99
5.7k
A better future with KSS
kneath
231
16k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
19
1.7k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
How GitHub Uses GitHub to Build GitHub
holman
468
290k
Art, The Web, and Tiny UX
lynnandtonic
289
19k
The Cost Of JavaScript in 2023
addyosmani
16
3.9k
Transcript
CSS clip-path の紹介 Press Space for next page
自己紹介 📝 飯野陽平(wheatandcat ) 🏢 フリーランスエンジニア(シェアフル株式会社CTO ) 💻 Blog: https://www.wheatandcat.me/
📚 Booth: https://wheatandcat.booth.pm/ 🛠 今までに作ったもの memoir ペペロミア Atomic Design Check List
clip-path とは clip-path はCSS のプロパティで、 要素のどの部分を表示するかを設定するクリッピング領域を指定できるCSS 。 具体的には、HTML の要素の一部をトリミングしたり、SVG のPath
を指定して動的に表示することができる。 MDN clip-path
対応ブラウザ https://caniuse.com/?search=clip-path
使っても大丈夫か? IE11 以外のブラウザは、ほぼサポート済み IE11 のサポートも2022 年6 月15 日で終了なので、それ以降は使ってもOK 👌
clip-path に設定できる値 値 内容 inset 四角形を設定 circle 丸を設定 ellipse 楕円を設定
polygon 多角形を設定
実際にサンプルを作ってみた
斜め線を使用したデザイン https://try-css.vercel.app/clippath/section
clip-path で四角形を書く https://try-css.vercel.app/clippath/inset
clip-path で丸を書く https://try-css.vercel.app/clippath/circle
clip-path で三角形を書く https://try-css.vercel.app/clippath/triangle
clip-path でカードにリボンをつける https://try-css.vercel.app/clippath/ribbon
clip-path でボタンにアニメーションをつける https://try-css.vercel.app/clippath/button
clip-path で画像を切り抜く https://try-css.vercel.app/clippath/image
clip-path を使ってデザインしてみる https://try-css.vercel.app/clippath/screen
clip-path を使ってデザインしてみる https://try-css.vercel.app/clippath/screen
おまけ : clip-path でサーチライトっぽいアニメーション https://try-css.vercel.app/clippath/light
まとめ 今までcss のborder で無理やり実装していた箇所が、clip-pat でスッキリかけるようになった。 アニメーションと組み合わせれば色々できる https://digipress.info/tech/revealing-text-by-clip-path/ IE11 のサポート期間が終わったら、色々な場面でも使用しても良さそう。
ご清聴ありがとうございました