CSS
åºæ¬çã«border-radiusãç辺ã®ååãæå®ããã°OKã§ãããå¤æ°ã使ããªãã¨ããã¿ã³ã®ãµã¤ãºãå¤æ´ã«ãªããã³ã«åè¨å®ãå¿ è¦ã¨ãªãã¾ãã ãããªã¨ãã border-radius: 9999px; ãã border-radius: 100vmax; ãªã©ãborder-radiusã«å¤§ããªå¤ãå ¥ããã°ãã¿â¦
vhãdvhãsvhãlvhãã¤ãã§ã«window.innerHeightã®å¤ã観測ã§ããã¦ã§ããµã¤ããä½ãã¾ãããhttps://viewport-height.vercel.app DEMO iOS Safari iOS Chrome iOSã®Safariã¨Chromeã§vhã®æ±ããç°ãªããã¨ããããã¾ãã ã¡ãªã¿ã«Android Chromeã¯iOS Safariâ¦
text-align: justify developer.mozilla.orgããã¹ãã両端æãã«ãã¾ãã å³å¯ã«è¨ãã°æåè©°ãã¨ã¯å¥ã®å¦çãªã®ã§ãããçµæçã«æåéã調æ´ããã¾ãã font-feature-settings: 'palt' developer.mozilla.orgOpenTypeã®ãããã¼ã·ã§ãã«ã¡ããªã¯ã¹ãæå¹â¦
DEMO å¶ç¶çºè¦ããã³ã³ããã¼ã·ã§ã³ãªã®ã§ãããä¸è¨iframeã¯Safariã§ã¹ã¯ãã¼ã«ã§ãã¾ãããï¼17.5ã«ã¦ç¢ºèªï¼ Google Chromeï¼126.0.6478.61ï¼ãFirefoxï¼112.0.1ï¼ã§ã¯åé¡ãªãã¹ã¯ãã¼ã«ã§ãã¾ãã ã½ã¼ã¹ã³ã¼ãï¼æç²ï¼ #scroll { // ⶠposition: relatiâ¦
親è¦ç´ ã«flexãè¨å®ãã åè¦ç´ ã«ä¸è¨CSSãå½ã¦ã overflow: hidden; text-overflow: ellipsis; white-space: nowrap; ããã§ãã¦ã£ã³ãã¦ãµã¤ãºã縮ããéãåè¦ç´ ã¯å¹ ã縮ãã¦è¦ç´ å ã®ããã¹ããçç¥ã§ãã¾ãã DEMO ããããåè¦ç´ ã®ä¸ã«å¹ ã縮ããããªãâ¦
ãã¾ã¾ã§ãfloat ã ã£ããã flex ã ã£ãããmediaã¯ã¨ãª ã§ç»é¢å¹ ãã¨ã«å®ç¾©ããããã¨ãã«JavaScriptã§ãããããããããªããå®è£ ãã¦ãããå·¦æãã§æ¨ªä¸¦ã³ã«ããè¦ç´ ã®ã»ã³ã¿ãªã³ã°ã§ãããã°ãªããã¬ã¤ã¢ã¦ãã使ãã°ãã®ãããã·ã³ãã«ã«å®ç¾ã§ãããâ¦
åã åã®detailsè¦ç´ ã¨ååã®grid-template-rowsã®åããæã§ããblog.kimizuka.org blog.kimizuka.orgdetailsè¦ç´ ã®ééã«ã¢ãã¡ã¼ã·ã§ã³ãè¨å®ãããå ´åãæ¬å½ã¯openå±æ§ã®æç¡ã§åè¦ç´ ã®grid-template-rowsãå¤æ´ãããã¨ã§ãJavaScriptãªãã§å®ç¾ã§ããâ¦
DOMã®é«ãã0ããautoã«CSSã¢ãã¡ã¼ã·ã§ã³ã§ã¹ã ã¼ãºã«å¤æ´ãããã¨ããgrid-template-rowsã使ãã¨ããæãã«ãªãã¨ãããã¨ãæãã¦ããã ãã¾ããã DEMO SCSSï¼æç²ï¼ dd { display: grid; // ⶠgrid-template-rows: 0fr; // ⸠transition: grid-templatâ¦
detailsè¦ç´ èªä½ãã¢ãã¡ã¼ã·ã§ã³ãããå ´å detailsè¦ç´ èªä½ã«transitionãè¨å®ããopenå±æ§ã®æç¡ã§ããããã£ãå¤åãããã¨ãã¯ã¢ãã¡ã¼ã·ã§ã³ãã¾ãã â» Google Chromeï¼123.0.6312.124ï¼ã§ãã確èªãã¦ãã¾ããã DEMO SCSS details { background: rgbâ¦
\Aã§æ¹è¡ã§ãããã¨ãç¥ãã¾ããã white-space: pre-wrapã¨ã»ããã§è¨å®ããå¿ è¦ãããã¾ãã SCSS p { &:after { white-space: pre-wrap; content: 'æ¹\Aè¡'; } } DEMO é¢é£è¨äº blog.kimizuka.org
以åã¤ãã£ãDEMOããã¨ã«ãå·¦ä¸ã«å ¥åããçµµæåãä¸å両æããDEMOãã¤ããã¾ãããblog.kimizuka.org DEMO ã½ã¼ã¹ã³ã¼ãï¼æç²ï¼ çµµæåã®å¤å® document.querySelector('input').addEventListener('input', (evt) => { if (evt.target.value.length === 2â¦
position: stickyã使ãã¨ãç°¡åã«å¸çããããããªãã¼ã¸ã¹ã¯ãã¼ã«ãå®è£ ã§ãã¾ããdeveloper.mozilla.org DEMO é常ã«æ軽ã§ããããããããã«ãã¼ã¸å ãªã³ã¯ãscrollIntoViewã使ã£ã¦å®è£ ããã¨ã¡ãã£ã¨ããåé¡ãèµ·ããã¾ããå ·ä½çã«ããã¨ãç¾å¨ä½ç½®â¦
CSSã§æ¦ãã¬ã©ã¹è¶ãã«è¦ã¦ãããããªã¨ãã§ã¯ããããããéãbackdrop-filterã使ãã¨ããæãã«å®è£ ã§ãã¾ãã DEMO ã½ã¼ã¹ã³ã¼ãï¼æç²ï¼ CSS .backdrop-filter { backdrop-filter: blur(4px); } ããããç¾ç¶ã§ã¯Safariã§ä½¿ç¨ããã«ã¯ãã³ãã¼ãã¬ãã£â¦
é·ããiOSã®Safariã§ã¯ãinputè¦ç´ ã«user-select: noneãæããã¨ããã©ã¼ã«ã¹æã«ãã¼ãã¼ãã表示ããã¾ããã§ããã åã¯ãElectronãPWAãéçºãããã¨ãå¤ãã®ã§ã * { -webkit-user-select: none; user-select: none; ã¨ãã¦ãã¾ããã¨ãå¤ãã£ãã®ã§â¦
developer.mozilla.orgOSã®ãã¼ã¯ã¢ã¼ãã§ãããã¡ãã£ã¢ã¯ã¨ãªã§ç°¡åã«å¤å®ã§ãã¾ãã @media (prefers-color-scheme: dark) { /* ãã¼ã¯ã¢ã¼ãã®ã¹ã¿ã¤ã«ãæ¸ã */ } DEMO æè¿ã¤ãã£ã¦ãããPWAããã¼ã ç»é¢ã«ç»é²ãããã¨ãä¿ããããã¢ããã§ãã ã©ã¤â¦
ãã©ãããªãã¿ã³ã欲ãããªã£ã¦ãã¯ãã㯠ã¤ã©ã¹ãã¬ã¼ã¿ã¼ ã§ä½ã£ã¦SVGã§æ¸ãåºããã¨æã£ã¦ããã®ã§ãããåã®ã¤ã©ã¬ã¹ãã«ã ã¨ãCSSã§ä½ã£ã¦ãã¾ã£ãæ¹ãæã£åãæ©ãã£ãã®ã§ãCSSã§ãããã£ã¨ã¤ãã£ã¦ã¿ã¾ããã DEMO See the Pen button by kimmy (@â¦
Electronã§å±ç¤ºç¨ã®ã¢ããªã±ã¼ã·ã§ã³ãã¤ãã£ãæãªã©ã«å½¹ã«ç«ã¤Tipsãªã®ã§ãããCSSã§ã html { cursor: none; } ã¨æå®ããã°ãã¦ã¹ã«ã¼ã½ã«ãé表示ã«ãªãã¾ãã DEMO 常ã«é表示ã«ããã¨ã調æ´æãªã©ã«å°ã£ããã¨ã«ãªãã®ã§ãä½ãæ¡ä»¶ãã¤ãã¦è¡¨ç¤ºã»é表â¦
iOSã®Safariã§buttonã¿ã°ãé£æããéãããã«ã¿ããã¨å¤å®ãããç»é¢ãæ¡å¤§ã»ç¸®å°ããç¾è±¡ã«å°ã£ã¦ãã¾ãããhttps://develop.kimizuka.org/touch-action/auto/ ãiOS16.13.1ã®Safariã§ç¢ºèªããæ§å ãã¿ã³ãããã«ã¿ããããã¨ç»é¢ãæ¡å¤§ã»ç¸®å°ããdevelopâ¦
ã¿ã¤ãã«ã®éãã§ãããã¯ãªãã¯ããç®æãèµ·ç¹ã«DOMãçã£äºã¤ã«ä¸å両æããããªã¨æããã³ã¼ããæ¸ãã¦ã¿ã¾ããã æãåºã®ä¸ã®FF6ã®æ¬éå£ã®ãããªã¤ã¡ã¼ã¸ã§å¶ä½ãã¾ããããã·ã³ãã«ã«ä»ä¸ããããã«ã¨ãã§ã¯ãã¯å ¥ãã¦ãã¾ããã ä¸å¿ã横æ¹åã縦æ¹â¦
ã¯ããã« çµè« pxæå® mmæå® èª¿æ» â¶ ã°ãªããã表示ãã¦è¨æ¸¬ ã½ã¼ã¹ã³ã¼ã çµæ èª¿æ» â· DOMã®å¤§ãããmmã§æå®ãã¦è¨æ¸¬ ã½ã¼ã¹ã³ã¼ã çµæ çµè« ã¯ããã« æè¿ãHTMLãPDFã«å¤æãããã¨æããã¨ãå¢ãã¦ãã¾ãã¦ããããã調æ»ãã¦ããã®ã§ããããããªä¸â¦
ããã¾ã§ãã¢ã¹ãã¯ãæ¯ãåºå®ãã¤ã¤ãµã¤ãºå¯å¤ã®DOMãã¤ããéã¯ãbeforeè¦ç´ ã®padding-topã使ã£ã¦ã¾ããã DEMO ã½ã¼ã¹ã³ã¼ãï¼æç²ï¼ SCSS div { width: 50%; background: red; &:before { display: block; padding-top: calc(100% * 9 / 16); content: â¦
developer.mozilla.orgtransform-matrixã使ã£ã¦ãã¯ãªãã¯ããç®æãåºæºã«2åã«æ¡å¤§ããåè§å½¢ãã¤ããã¾ãããããä¸åº¦ã¯ãªãã¯ããã¨å ã®å¤§ããã«æ»ãã¾ãã DEMO ã½ã¼ã¹ã³ã¼ã JavaScript const rect = document.getElementById('rect'); let scale = 1â¦
ãã¾ã¾ã§æèãããã¨ããªãã£ãã§ããããã©ã³ããã¡ããªã¼ãå¤æ´ããã¨ãliã¿ã°ã®ãã¼ã«ã¼ï¼å·¦ã«ã¤ãã¦ããé»ä¸¸ãæ°åãªã©ï¼ãµã¤ãºãçµæ§å¤ãããã¨ãããã¾ãã DEMO PCçã®Google ChromeãNoto Sans JPãã¨ãsan-serifãã並ã¹ã¦ãã¾ãããé»ä¸¸ã¯ãNotoâ¦
以åãclip-pathã§DOMã«ãã¹ã¯ãæãã¤ã¤drop-shadowã§å½±ãè½ã¨ãããã¨ããã£ãã®ã§ãããclip-pathã¨borderãä½µç¨ã§ããªãããªã¨æãè²ã 試ãã¦ã¿ã¾ãããblog.kimizuka.orgçµè«ã¨ãã¦ã¯borderã¨ã®ä½µç¨ã¯é£ãããåãclip-pathãè¨å®ããè¦ç´ ããµã¤ãºéãâ¦
Googe Chromeã§ã¯input type="time"ã®å³ç«¯ã«æè¨ã®ã¢ã¤ã³ã³ã表示ããã¾ãããã®ã¢ã¤ã³ã³ã¯ã [input type="time"]::-webkit-calendar-picker-indicator ã¨ããCSSã»ã¬ã¯ã¿ã§ã»ã¬ã¯ãã§ããã®ã§ãé表示ã«ãããå ´åã [input type="time"]::-webkit-calendaâ¦
DEMO clip-pathã§åãæããDOMãhtml2canvasã§ç»ååããã¨ãclip-pathãç¡è¦ããã¾ãã ãããã試ããã¨ãããdom-to-imageã¨ããã©ã¤ãã©ãªã使ã£ã¦ã¿ãã¨ããã£ããã¨clip-pathãåæ ãããã¨ãã§ãã¾ãããgithub.com html2canvasã§ç»åå dom-to-imagâ¦
CSSã®scroll-snapãã¤ãã£ã¦ã«ã«ã¼ã»ã«ãã¤ãã£ã¦ã¿ã¾ãããdeveloper.mozilla.org ã«ã¼ãç¡ã DEMO ã½ã¼ã¹ã³ã¼ãï¼æç²ï¼ JavaScript const { useEffect, useRef, useState } = React; function App() { const [ list ] = useState([1, 2, 3]); const widthâ¦
å æ¥ãradial-gradientã使ã£ã¦ãããã¨ããåãæããã¨æã£ãéã«ãåå½¢ã°ã©ãã¼ã·ã§ã³ã®%ã®æå®ããåã«å æ¥ããåè§å½¢ã®å¤§ãããæå®ãã¦ãããã¨ã«æ°ã¥ãã¾ããã ã½ã¼ã¹ã³ã¼ãï¼æç²ï¼ div { display: flex; align-items: center; justify-content: ceâ¦
accent-colorã¨ããCSSããããã£ã使ãã°ãinputè¦ç´ ã®è²ãå¤æ´ã§ãããã¨ããã¾ãããdeveloper.mozilla.orgInternet Explorerã¯é対å¿ã§ãããã¢ãã³ãã©ã¦ã¶ã®ææ°çã§ããã°åé¡ãªã使ããããã§ãã æ¤è¨¼ ã½ã¼ã¹ã³ã¼ã input { accent-color: red; } â¦
linear-gradientã¨background-sizeããã¾ã使ãã¨ãèæ¯ã«ç¹°ãè¿ãã§ç·ãå¼ããã¨ãã§ãã¾ãã DEMO CSS div { position: absolute; top: 0; bottom: 0; left: 0; right: 0; background: linear-gradient(0deg, red 1px, transparent 1px); background-size:â¦