2021-02-01から1ヶ月間の記事一覧
<svg fill="currentColor"> <use href="/img/foo.svg#id=bar" /> </svg> svg { color: red; } ポイントは下記 svgタグにfill="currentColor"またはfill: currentColorを設定する useタグのhref属性にidをつけ、svgファイル側のsvgタグにid属性を設定する useタグの代わりにimageタグを使っても画像を外部読み込みできるが、その…
foo[indicies[increment]]的な実装がしたくて、このfoo配列の要素のインデックスだけを羅列した配列indiciesを作りたかった。 const foo = ["a", "b", "c"]; const indices = foo.map((_, index) => { return index; }); console.log(indices); => [0, 1, 2]…
各ベンダーごとにイベントリスナーを追加して、fullscreenchangeイベントを検知する必要がある。 (MDN見る限り、フルスクリーンAPIの諸々がSafariに対応してないのでちょっとめんどくさい) developer.mozilla.org document.addEventListener("webkitfullsc…