new wings

プログラミングを始めたので、感想を書いてくと思います

bulma でカスタムカラーを追加する

bulma.io

scss を cssコンパイルできる前提。idolColors.scss を idolColors.cssコンパイルして index.html で読み込む。

/* idolColors.scss */

/* findColorInvert, findLightColor, findDarkColor 関数を使えるように先にインポートしておく。 */
@import "bulma/sass/utilities/functions.sass";
$haruka: #e22b30;
$chihaya: #2743d2;
$miki: #b4e04b;
$custom-colors: (
  "haruka": ( /* クラス名 is-haruka で使えるようになる。以下同様。 */
    $haruka,
    findColorInvert($haruka),
    findLightColor($haruka),
    findDarkColor($haruka)
  ),
  "chihaya": (
    $chihaya,
    findColorInvert($chihaya),
    findLightColor($chihaya),
    findDarkColor($chihaya)
  ),
  "miki": (
    $miki,
    findColorInvert($miki),
    findLightColor($miki),
    findDarkColor($miki)
  )
);
@import "bulma";
<!-- index.html -->

<link rel="stylesheet" href="idolColors.css">
<button class="button is-haruka">is-haruka</button>
<button class="button is-chihaya">is-chihaya</button>
<button class="button is-miki">is-miki</button>

f:id:namaharumaki:20200201165820p:plain