Skip to main content

Module helpers

Module helpers 

Source

Functions§

ascii_eq_ignore_case 🔒
extract_all_url_paths 🔒
background-image: url(a.png), url(b.png) のような複数レイヤーから 全ての url(...) パスを出現順(CSS の重なり順どおり先頭が最前面)で抽出する。
extract_list_style 🔒
list-style-type を抽出。list-style-type 優先、無ければ list-style ショートハンドから 既知のキーワードを拾う。未指定は空(デフォルトのマーカー挙動)。
extract_list_style_image 🔒
list-style-image: url(...) を抽出。list-style-image 優先、無ければ list-style ショートハンド中の url(...) トークンを拾う。未指定/none は空文字(従来通り list-style-type のグリフを使う)。
extract_list_style_inside 🔒
list-style-position を抽出。list-style-position 優先、無ければ list-style ショートハンド から拾う。既定は “outside”(true を返せば inside)。
extract_url_path 🔒
get_base_path 🔒
hash_str
parse_bg_position 🔒
background-position を解析。(x_frac, y_frac) の 0.0-1.0 アンカーを返す。未指定は (0,0)。
parse_bg_repeat 🔒
background-repeat を解析。(repeat_x, repeat_y) を返す。未指定は (Repeat, Repeat)(CSS既定)。repeat-x/repeat-y は片軸 no-repeat のショートハンド。 <x> <y> の2値構文(例: repeat space, round no-repeat)にも対応する。
parse_bg_size 🔒
background-size を解析。未指定/解析不能なら Stretch(従来互換の全面引き伸ばし)。
parse_object_fit 🔒
object-fit を解析。未指定/不明値は Fill(従来互換の全面引き伸ばし)。
parse_object_position 🔒
object-position を解析。background-position と同じキーワード/割合構文だが、 未指定時の既定は (0.5, 0.5)(中央)で background-position の (0,0) とは異なる。
parse_outline 🔒
outline(ショートハンド or 個別プロパティ)から (color, width_px, style) を抽出する。 style は dashed/dotted のみ区別し、それ以外(solid 含む)は “solid” 扱いにする 簡略実装。outline-style:none や幅0は無効。
parse_px_val 🔒
parse_text_decoration_shorthand 🔒
text-decoration ショートハンド(underline wavy red のように line/style/color を 空白区切り任意順で並べられる)を解析する。戻り値: (underline指定, line-through指定, overline指定, none指定, style, color)。line キーワードが無いトークン列の場合、対応する bool は false のまま返す(呼び出し側で「未指定」と区別せず既存状態を保つかは呼び出し側の 判断に委ねる)。blink は認識するのみで描画には反映しない(点滅テキストは非対応)。
parse_transform 🔒
CSS transform プロパティを (tx, ty, scale_x, scale_y, rotate_deg, skew_x, skew_y) に簡易パース。
parse_transform_origin 🔒
transform-origin を解析。background-position と同じキーワード/割合構文だが、 未指定時の既定は (0.5, 0.5)(中央。CSS仕様どおり)。
resolve_dom_paths 🔒
resolve_relative_path 🔒
url_encode