This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { loadDefaultJapaneseParser } from 'budoux' | |
const parser = loadDefaultJapaneseParser() | |
/** | |
* 文字列を解析して、適切に改行されるように`wbr`タグを挿入します。 | |
* IEは`wbr`タグに対応していません。 | |
* @see https://caniuse.com/wbr-element | |
* @see https://github.com/google/budoux/tree/main/javascript | |
* @param {HTMLElement} element 最適化する要素 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//- @param {Object} params | |
//- @param {String} params.name [""] SVGスプライトのid名 | |
//- | |
//- @examples Input | |
//- +Icon({ name: "menu" }) | |
//- @examples Output | |
//- <svg role="img"> | |
//- <use xlink:href="/assets/svg/sprite.svg#menu"></use> | |
//- </svg> | |
mixin Icon(params={}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//- @param {Object} params | |
//- @param {String} params.src [""] 画像パス | |
//- @param {String} params.srcset [""] 画像のalt属性値 | |
//- | |
//- @examples Input | |
//- +Picture({ src: "https://placehold.jp/300x300.png", alt: "" }) | |
//- +Picture_Source({ media: "lg", srcset: "https://placehold.jp/1000x1000.png" }) | |
//- +Picture_Source({ media: "md", srcset: "https://placehold.jp/600x600.png" }) | |
//- | |
//- @examples Output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//- @param {Object} params | |
//- @param {boolean|string} params.start [false] start属性値を出力するかの真偽値、または出力する数値 | |
//- | |
//- @examples Input | |
//- +ListOrder | |
//- +ListOrder_Item リスト1 | |
//- +ListOrder_Item リスト2 | |
//- +ListOrder_Child | |
//- +ListOrder_Item リスト2-1 | |
//- +ListOrder_Item リスト2-2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//- @param {Object} params | |
//- @param {String} params.id [""] id属性値 | |
//- @param {String} params.name [""] name属性値 | |
//- @param {String} params.value [""] value属性値 | |
//- @param {boolean} params.disabled [false] disabled属性値を出力するかの真偽値 | |
//- @param {boolean} params.error [false] エラー表示用のクラスを出力するかの真偽値 | |
//- | |
//- @examples Input | |
//- +Checkbox({id: "checkbox1-1", name: "checkbox1", value: "0"}) チェックボックス1 | |
//- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// package.jsonの`scripts`に以下のように指定する | |
// "duplicateFiles": "node scripts/duplicateFiles.js" | |
const fs = require('fs-extra') | |
// 複製元のパス | |
const src = './src/' | |
// 複製先のパス | |
const dest = './public/' | |
// `dest`をフォルダごと、すべて削除する | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 要素が横スクロール可能な状態かを返します。 | |
* @param {HTMLElement} element テーブルをスクロールしている親要素 | |
* @return Boolean | |
* @example | |
* const tables = document.querySelectorAll('.table-wrap') | |
* Array.from(tables).forEach((table) => { | |
* canScrolled(table) ? canFunc() : notFunc() | |
* }) | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @desc - `background-image`で破線を作ります | |
// @param {String} $height [1px] - 破線の高さを指定します。 | |
// @param {String} $borderWidth [4px] - ボーダー(実線)の幅を指定します。 | |
// @param {String} $borderColor [currentColor] - ボーダー(実線)の色を指定します。 | |
// @param {String} $intervalWidth [2px] - 間隔の幅を指定します。 | |
// @param {String} $intervalColor [transparent] - 間隔の色を指定します。 | |
// @example scss - Usage | |
// .foo { @include dashed-line(1px, 4px, #000, 2px, transparent); } | |
// | |
// @example css - CSS output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('dotenv').config({ | |
path: '.env.local', | |
}) | |
const Client = require('node-rest-client').Client | |
const fs = require('fs') | |
const CMS_ROOT_ENDPOINT = `${process.env.CMS_ROOT_ENDPOINT}` | |
const CMC_API_KEY = `${process.env.CMC_API_KEY}` |