サポートする CSS 機能
Vivliostyle は現在、以下の各 CSS 機能(値、セレクタ、アットルール、メディアクエリ、プロパティ)をサポートしています。
このほかにも、ブラウザでサポートされる CSS プロパティと値は基本的にすべて利用可能です。Vivliostyle.js は独自の処理をしない CSS プロパティについてはブラウザに処理を任せるためです。
値
- CSS 全体キーワード:
initial,inherit,unset,revert - 長さの単位:
em,ex,ch,rem,lh,rlh,vw,vh,vmin, vmax,vi,vb,cm,mm,q,in,pc,pt,px. - サイジングキーワード: min-content, max-content, fit-content
- カラー値
- 色名
transparentカラーキーワードcurrentColorカラーキーワード- RGB 関数:
rgb(),rgba() - RGB 16進数表記: #RRGGBB, #RRGGBBAA
- HSL カラー:
hsl(),hsla() - HWB カラー:
hwb() - CMYK カラー:
device-cmyk()- ブラウザレンダリング用に内部的に
color(srgb ...)に変換されます。Vivliostyle CLI との後処理によるCMYK出力を可能にします。PR #1627 を参照
- ブラウザレンダリング用に内部的に
- 属性参照:
attr()contentプロパティの値としてのみサポートします。- 'string' 型と 'url' 型のみサポートします。
- 相互参照:
target-counter(),target-counters()andtarget-text()contentプロパティの値としてのみサポートします。
string()関数(名前付き文字列)content()関数running()関数(ランニング要素)element()関数(ランニング要素)leader()関数calc()関数env()関数- css-env ドラフト仕様にはまだ定義されていませんが、ページヘッダー作成に便利な
env(pub-title)とenv(doc-title)のみ実装しています。env(pub-title): 出版物タイトル = EPUB、ウェブ出版物、またはプライマリエントリーページの HTML タイトル。env(doc-title): ドキュメントタイトル = HTML タイトル。複数の HTML ドキュメントで構成される出版物では、章や節のタイトルになることがあります。
- css-env ドラフト仕様にはまだ定義されていませんが、ページヘッダー作成に便利な
var()関数
セレクタ
CSS 2
- ユニバーサルセレクタ
* - 型セレクタ
E - 子孫セレクタ
E F - 子セレクタ
E > F - 隣接兄弟セレクタ
E + F - 属性セレクタ
E[foo],E[foo="bar"],E[foo~="bar"],E[foo|="bar"] - クラスセレクタ
E.foo - ID セレクタ
E#foo :first-child擬似クラス- リンク擬似クラス
E:link - 言語擬似クラス
E:lang(c) :first-line擬似要素:first-letter擬似要素:before・:after擬似要素
サポートされていないセレクタ
Selectors 3
- 名前空間付き型セレクタ
ns|E,*|E - 名前空間付きユニバーサルセレクタ
ns|*,*|* - 部分一致属性セレクタ
[att^=val],[att$=val],[att*=val] - 名前空間付き属性セレクタ
[ns|att],[|att],[ns|att=val],[|att=val],[ns|att~=val],[|att~=val],[ns|att|=val],[|att|=val],[ns|att^=val],[|att^=val],[ns|att$=val],[|att$=val],[ns|att*=val],[|att*=val] - UI 要素状態擬似クラス
:enabled,:disabled,:checked,:indeterminate- 注: 現在の実装では、これらの UI 要素の初期状態のみ使用できます。ユーザーの操作で実際の状態が切り替わっても、スタイルは変わりません。
:root擬似クラス:nth-child()擬似クラス:nth-last-child()擬似クラス:nth-of-type()擬似クラス:nth-last-of-type()擬似クラス:first-child擬似クラス:last-child擬似クラス:first-of-type擬似クラス:last-of-type擬似クラス:only-child擬似クラス:only-of-type擬似クラス:empty擬似クラス:not()擬似クラス::first-line擬似要素::first-letter擬似要素::before・::after擬似要素- 一般兄弟結合子
E ~ F
Selectors 4
CSS Overflow 4
CSS Pseudo-Elements 4
CSS Generated Content for Paged Media (GCPM) 3
::footnote-call擬似要素::footnote-marker擬似要素list-style-position: outsideをサポートし、リストマーカーのようにマーカーを脚注本文の外側に配置できます。PR #1706 を参照
サポートされていないセレクタ
アットルール
CSS 2
CSS Namespaces 3
CSS Conditional Rules 3
CSS Conditional Rules 4
CSS Paged Media 3
- @page
- ページマージンボックス (@top-left-corner, @top-left, @top-center, @top-right, @top-right-corner, @left-top, @left-middle, @left-bottom, @right-top, @right-middle, @right-bottom, @bottom-left-corner, @bottom-left, @bottom-center, @bottom-right, @bottom-right-corner)
- ページセレクタ
- :left, :right
- :recto, :verso
- :first
- 注: 複数ドキュメントの出版物では、
:firstは最初のドキュメントの最初のページにのみ一致し、:nth(1)は各ドキュメントの最初のページに一致します。Issue #667
- 注: 複数ドキュメントの出版物では、
- :blank
- 名前付きページ(ページタイプセレクタ)
- ページベースカウンタ(page、pages)
CSS Generated Content for Paged Media (GCPM) 3
@footnoteルール(脚注エリア)@page { @footnote { … } }の形式で脚注エリアのスタイルを指定します- ページセレクタの組み合わせをサポート: 例
@page :left { @footnote { … } } @footnote ::beforeでcontentプロパティなどによる脚注セパレータのスタイル指定をサポート@page @footnoteはトップレベルの@footnoteより優先されます- PR #1644 を参照
- N番目ページセレクタ
:nth(An+B [of <custom-ident>]):nth(An+B of <page-type>)はページグループを考慮したマッチングを行い、現在のページ上のすべてのアクティブなページグループに対して評価されます。PR #1745 を参照- 注: 複数ドキュメントの出版物では、
:nth(1)は各ドキュメントの最初のページに一致しますが、:firstは最初のドキュメントの最初のページにのみ一致します。Issue #667
参照:
CSS Fonts 3
CSS Counter Styles 3
メディアクエリ
- Vivliostyle は
printメディア(およびall)向けに指定されたスタイルを使用します。printメディアに加えて、Vivliostyle 固有のメディアタイプvivliostyleが有効化されます。
- サポートされるメディア機能
プロパティ
CSS 2
- background
- CSS Backgrounds 3 の構文をサポートします
- background-attachment
- CSS Backgrounds 3 の構文をサポートします
- background-color
- CSS Backgrounds 3 の構文をサポートします
- background-image
- CSS Backgrounds 3 の構文をサポートします
- background-position
- CSS Backgrounds 3 の構文をサポートします
- background-repeat
- CSS Backgrounds 3 の構文をサポートします
- border
- border-bottom
- border-bottom-color
- border-bottom-style
- border-bottom-width
- border-collapse
- border-color
- border-left
- border-left-color
- border-left-style
- border-left-width
- border-right
- border-right-color
- border-right-style
- border-right-width
- border-spacing
- border-style
- border-top
- border-top-color
- border-top-style
- border-top-width
- border-width
- bottom
- caption-side
- clear
- 参照: CSS Page Floats
- clip
- color
- content
- counter-increment
- counter-reset
- counter-set
- cursor
- direction
- display
- empty-cells
- float
- 参照: CSS Page Floats
- font
- font-family
- font-size
- font-style
- font-variant
- CSS Fonts 3 の font-variant をサポートします
- font-weight
- height
- left
- letter-spacing
- line-height
- list-style
- list-style-image
- list-style-position
- list-style-type
- margin
- margin-bottom
- margin-left
- margin-right
- margin-top
- max-height
- max-width
- min-height
- min-width
- orphans
- outline
- outline-color
- outline-offset
- outline-style
- outline-width
- overflow
- padding
- padding-bottom
- padding-left
- padding-right
- padding-top
- page-break-after
- page-break-before
- page-break-inside
- position
- quotes
- 注:
@pageルール内ではサポートされません。Issue #43
- 注:
- right
- table-layout
- text-align
- text-decoration
- text-indent
- text-transform
- top
- unicode-bidi
- vertical-align
- visibility
- white-space
- widows
- width
- word-spacing
- z-index
CSS Paged Media 3
- bleed
- ページセレクタのない
@pageルール内で指定した場合にのみ有効
- ページセレクタのない
- marks
- ページセレクタのない
@pageルール内で指定した場合にのみ有効
- ページセレクタのない
- size
- 必須値すべてと、提案値
A0–A10、B0–B10、C0–C10、JIS-B0–JIS-B10をサポートします。PR #713 を参照
- 必須値すべてと、提案値
- crop-offset
- トリムサイズの端から出力ページメディアサイズの端までの距離を指定します
- このプロパティはまだ標準化されていません。Issue #913 を参照
- crop-marks-line-color
- トンボマークの色を指定します
- このプロパティはまだ標準化されていません。PR #1505 を参照
- page (名前付きページ)
CSS Generated Content for Paged Media (GCPM) 3
- string-set(名前付き文字列)
- position: running()(ランニング要素)
- footnote-display
block、inline、compact値をサポートします。
- footnote-policy
auto、line値をサポートします。
参照:
CSS Fragmentation 3
- break-after
- break-before
- break-inside
- 注:
avoid-page、avoid-column、avoid-region値はいずれもavoidとして扱われます。Issue #128
- 注:
- orphans
- widows
- box-decoration-break
- 注: インラインの始端/終端における背景、box-shadow、ボーダー画像は常に
box-decoration-break: cloneが指定されたかのようにレンダリングされます。
- 注: インラインの始端/終端における背景、box-shadow、ボーダー画像は常に
CSS Fragmentation 4
CSS Page Floats
- clear
none、inline-start、inline-end、block-start、block-end、left、right、top、bottom、both、all、same値をサポートします。- ブロックレベルボックス(ページフロート以外)に
allを指定すると、ドキュメント順序でこのボックスより前にアンカーがある block-start / block-end ページフロートの後にボックスの block-start 辺が来るように下げられます。 - ページフロートに
clear値を指定すると、先行のページフロートの後に配置されます。 same値は、そのページフロートがフロートしている方向と同じ方向を意味します。float: snap-blockのページフロートが block-start 端に配置されるところが、clear値によりその配置が禁止される場合、フロートは代わりに block-end 側に配置されます(clear値がその配置も禁止しない場合)。page、column、region値は、先行のページフロートがclearプロパティを持つ要素(ページフロート、通常フロート、またはブロックレベルボックス)を含むページ/カラム/リージョンの前に配置されることを保証します。
- float
block-start、block-end、inline-start、inline-end、snap-block、left、right、top、bottom、none値をサポートします。- 複数のキーワードを組み合わせた値をサポートします。例:
float: top right;→ 右上隅にフロートfloat: bottom left;→ 左下隅にフロートfloat: top bottom;→ 上端または下端にフロートfloat: top bottom left;→ 左上隅または左下隅にフロートfloat: top bottom left right;→ 左上、右上、左下、または右下隅にフロートfloat: block-start inline-start;→ block-start かつ inline-start の隅にフロートfloat: block-start block-end;→ block-start または block-end 端にフロート('snap-block' と同じ)- PR #1444 を参照
- float-reference
float-reference: page(またはcolumn/region)を指定してページ(またはカラム/リージョン)フロートを有効化します。
- float-min-wrap-block
- ページフロートに対して適用されます
- パーセンテージ値は、ページフロートのフロート参照のブロック寸法に対して解釈されます
- 正の長さを指定すると、ページフロートの横の空間のブロック方向の長さが指定した長さ未満の場合、インフローコンテンツはその空間に流れ込めなくなり、その空間は空白のままになってコンテンツは次のカラムへ送られます
- このプロパティはまだ標準化されていません。PR #382 を参照
CSS Color 3
参照: 値 - サポートしているカラー値
CSS Backgrounds and Borders 3
- background
- background-attachment
- background-clip
- background-color
- background-image
- background-origin
- background-position
- background-repeat
- background-size
- border
- border-bottom
- border-bottom-color
- border-bottom-left-radius
- border-bottom-right-radius
- border-bottom-style
- border-bottom-width
- border-color
- border-image
- border-image-outset
- border-image-repeat
- border-image-slice
- border-image-source
- border-image-width
- border-left
- border-left-color
- border-left-style
- border-left-width
- border-radius
- border-right
- border-right-color
- border-right-style
- border-right-width
- border-style
- border-top
- border-top-color
- border-top-left-radius
- border-top-right-radius
- border-top-style
- border-top-width
- border-width
- box-shadow
CSS Images 3
- object-fit
- object-position
- image-resolution
<resolution>値のみサポートします。img、input[type=image]、video(ポスター画像に適用)要素と before/after 擬似要素のコンテンツのみサポートします。背景画像、リスト画像、ボーダー画像などはサポートしません。- ベクター画像(SVG など)にもラスター画像と同様に適用されます。この挙動は仕様記載と異なります。
CSS Fonts 3
CSS Text 3
- hanging-punctuation
- 必須値すべて「
none | [ first || [ force-end | allow-end ] || last ]」をサポートします。PR #814 を参照
- 必須値すべて「
- hyphens
- letter-spacing
- line-break
- overflow-wrap, word-wrap
- tab-size
- text-align-last
- 注: CSS Text 3 では
text-alignプロパティはショートハンドですが、Vivliostyle では引き続き CSS 2.1 で定義されたスタンドアロンのプロパティとして扱っています。
- 注: CSS Text 3 では
- white-space
- word-break
CSS Text 4
- text-autospace
- サポート値:
normal | no-autospace | [ ideograph-alpha || ideograph-numeric ] | auto
- サポート値:
- text-spacing-trim
- 値:
space-all | normal | space-first | trim-start | trim-both | auto
- 値:
- text-spacing
- 値:
normal | none | auto | [<autospace> || <spacing-trim>] - 注:
text-autospaceとtext-spacing-trimプロパティをまとめて設定するショートハンドプロパティです。PR #1142 を参照
- 値:
CSS Text Decoration 3
CSS Inline Layout 3
CSS Multi-column 1
Vivliostyle は CSS マルチカラムレイアウトをサポートしていますが、ルート・body 要素に指定された場合と、ルート・body 以外の要素に指定された場合とで扱いが異なり、それぞれに制限があります:
-
ルート段組(ルート要素または body 要素に指定):
- ルート要素と body 要素の両方に段組が指定された場合は、ルート要素に指定された段組のみがルート段組として扱われます。
- ページエリアがマルチカラムコンテナになります。
- Vivliostyle が独自に実装しているため、ブラウザの段組実装に依存しません。
- CSS Page Floats の
float-reference: columnはルート段組にのみ対応しています。 - 制限:
column-span: allはルート段組の場合にはページフロートに対してのみ対応しています。
-
非ルート段組(ルート・body 要素以外に指定):
- 段組の処理はブラウザの段組実装に依存します。
- 同一ページ内に段数の異なる複数の段組を混在させたり、段組の中に段組をネストしたり、
column-span: allで段抜きのレイアウトもできます。 - 注: この機能はブラウザの段組機能を利用しているため、Safari/WebKit で Vivliostyle.js を使用する場合には、WebKit の既知のバグによりネストした段組レイアウトが崩れることがある、または非ルート段組でのページ分割がうまくいかないことがあります。Issue #1821 を参照
-
- 注: ルート段組では、
column-spanはページフロートに指定した場合にのみ有効です。auto値を指定すると、ページフロートの min-content インラインサイズに応じて 1 カラムまたは全カラムにスパンします。 - 非ルート段組では、
column-span: allを制限なく使えます。
- 注: ルート段組では、
CSS Basic User Interface 3
CSS Writing Modes 3
CSS Flexible Box 1
CSS Transforms 1
Compositing and Blending 1
Scalable Vector Graphics (SVG) 2
- color-interpolation
- color-rendering
- fill
- fill-opacity
- fill-rule
- glyph-orientation-vertical
- image-rendering
- marker
- marker-start
- marker-mid
- marker-end
- pointer-events
- paint-order
- shape-rendering
- stop-color
- stop-opacity
- stroke
- stroke-dasharray
- stroke-dashoffset
- stroke-linecap
- stroke-linejoin
- stroke-miterlimit
- stroke-opacity
- stroke-width
- text-anchor
- text-rendering
- vector-effect
Scalable Vector Graphics (SVG) 1.1
CSS Masking 1
Filter Effects 1
Pointer Events
CSS Logical Properties and Values 1
- block-size, inline-size, min-block-size, min-inline-size, max-block-size, max-inline-size
- margin-block-start, margin-block-end, margin-inline-start, margin-inline-end, margin-block, margin-inline
- inset-block-start, inset-block-end, inset-inline-start, inset-inline-end, inset-block, inset-inline
- padding-block-start, padding-block-end, padding-inline-start, padding-inline-end, padding-block, padding-inline
- border-block-start-width, border-block-end-width, border-inline-start-width, border-inline-end-width, border-block-width, border-inline-width, border-block-start-style, border-block-end-style, border-inline-start-style, border-inline-end-style, border-block-style, border-inline-style, border-block-start-color, border-block-end-color, border-inline-start-color, border-inline-end-color, border-block-color, border-inline-color, border-block-start, border-block-end, border-inline-start, border-inline-end, border-block, border-inline
ページ方向 inside/outside プロパティと値
これらのプロパティと値では、inside および outside キーワードは、ページが左ページか右ページかに応じて left または right に解決されます。
注: これらの CSS プロパティと値はまだ標準化されていません。PR #1519 を参照
追加された *-inside/outside プロパティ:
- margin-inside, margin-outside
- padding-inside, padding-outside
- border-inside, border-outside
- border-inside-color, border-outside-color
- border-inside-style, border-outside-style
- border-inside-width, border-outside-width
- inset-inside, inset-outside
inside および outside 値が拡張されたプロパティ:
- float, clear
- text-align, text-align-last
CSS Repeated Headers and Footers
注: この仕様提案はまだ CSS Working Group に提出されていません。
セマンティック脚注(role 属性 / epub:type 属性)
Vivliostyle は、CSS GCPM の float: footnote プロパティによる脚注に加えて、HTML 要素のセマンティック属性を使った脚注をサポートしています。role 属性(DPUB-ARIA)または epub:type 属性(EPUB 3 Structural Semantics Vocabulary)によって、脚注参照と脚注本文を識別します。
- 脚注参照:
<a role="doc-noteref" href="#fn">1</a>または<a epub:type="noteref" href="#fn">1</a> - 脚注本文:
<aside role="doc-footnote" id="fn"><p>1. 脚注の本文</p></aside>または<aside epub:type="footnote" id="fn"><p>1. 脚注の本文</p></aside>
Issue #1700 を参照
EPUB Adaptive Layout
注: この仕様は W3C 標準化トラックにはありません。将来の Vivliostyle バージョンではこの仕様のサポートを廃止する可能性があります。
アットルール
プロパティ
- -epubx-conflicting-partitions
- -epubx-enabled
- -epubx-flow-consume
- -epubx-flow-from
- EPUB Adaptive Layout パーティションに指定した場合にのみ有効。
- -epubx-flow-into
- -epubx-flow-linger
- -epubx-flow-options
- -epubx-flow-priority
- -epubx-min-page-height
- -epubx-min-page-width
- -epubx-required
- -epubx-required-partitions
- -epubx-shape-outside
- EPUB Adaptive Layout パーティションに指定した場合にのみ有効。
- 注: 2012年5月3日 Working Draft の古い構文のみサポートします。
- -epubx-shape-inside
- EPUB Adaptive Layout パーティションに指定した場合にのみ有効。
- 注: 2012年5月3日 Working Draft の古い構文のみサポートします。
- -epubx-snap-height
- -epubx-snap-width
- -epubx-text-zoom
- -epubx-utilization
- -epubx-wrap-flow
- EPUB Adaptive Layout パーティションに指定した場合にのみ有効。