1. 序論
この仕様は、 次に挙げる 3 種の新たな特能を導入する — それらは、[ ~UAが色を[ いつ, どう ]自動-調整するか ]を制御することに関係する: ◎ This specification introduces three new features related to controlling how/when colors are auto-adjusted by the user agent:
- `色~scheme$と `color-scheme$p ~propは、 次を制御する ⇒ ~page内で~browserが供した~UIを成す各部は、 利用者が選んだ`色~scheme$を尊重するかどうか ◎ Color schemes and the color-scheme property, which controls whether or not browser-provided parts of the page’s UI respect the user’s chosen color scheme.
- `強制d色~mode$と `forced-color-adjust$p ~propは、 次を制御する ⇒ 所与の要素に`強制d色~mode$を適用することは、 許容されるかどうか ◎ Forced colors mode and the forced-color-adjust property, which controls whether or not forced colors mode is allowed to apply to a given element.
- `print-color-adjust$p ~propは、 次を制御する ⇒ 利用者が想定した処理能~選好 — 印刷-時に~inkを節約するため背景~色を抑止するなど — に合わせて色を自動的に調整することは、 ~browserに許容されるかどうか ◎ The print-color-adjust property, which controls whether the browser is allowed to automatically adjust colors to the user’s assumed performance preferences, such as suppressing background colors when printing to save ink.
この~moduleは、 次に挙げる`媒体~query$ `MEDIAQUERIES-5$r との併用を介して,[ 作者, 利用者 ]間の色~scheme折衝を許容する。 ⇒# `prefers-color-scheme$d, `prefers-contrast$d, `forced-colors$d ◎ Together with the prefers-color-scheme, prefers-contrast, and forced-colors media queries [MEDIAQUERIES-5], this module allows color scheme negotiation between the author and the user.
1.1. 値~定義
【 この節の内容は `~CSS日本語訳 共通~page@~CSScommon#values$に移譲。 】
2. 選好される色~scheme
~OSや~UAは、[ ~UI要素~用に `選好される色~scheme@ を選ぶ能 ]を利用者に与えることが多い。 この `色~scheme@ は、 概して,~page~UI要素 — ~UAの~form~controlや~scrollbarなど — に加えて[ ~navi~UIの描画 ]にも反映される。 ◎ Operating systems and user agents often give users the ability to choose their preferred color scheme for user interface elements. This color scheme is typically reflected in the user agent’s rendering of its navigation interface as well as in-page interface elements such as form controls and scrollbars.
~UAはまた、 利用者に次を許容できる ⇒ 自身が視る~pageに対し,`色~scheme$の選好を指示して、 その選好に~pageが順応するよう作者に要請する ◎終 (そのような選好を【作者へ】表出することは、 【~UAには】要求されない — 利用者は、[ ~OS~UI用の色~選好を~pageにも課したいとは求めない ]こともあるので)。 ◎ A UA can also allow the user to indicate a preference for the color scheme of the pages they view, requesting that the author adapt the page to those color preferences. (It is not required to express such a preference; users can have preferences for operating system interface colors that they do not want imposed on pages.)
最も共通的な`色~scheme$の選好は: ◎ The most common color scheme preferences are:
- `明な色~scheme@ ( “昼間~mode” )は、 明な背景~色と暗な[ 前景/~text ]色からなる。 ◎ A light color scheme ("day mode") consists of light background colors and dark foreground/text colors.
- `暗な色~scheme@ ( “夜間~mode” )は、 反対に, 暗な背景~色と明な[ 前景/~text ]色からなる。 ◎ A dark color scheme ("night mode") consists of the opposite, with dark background colors and light foreground/text colors.
注記: [ `明な色~scheme$/`暗な色~scheme$ ]は、 特定の色~paletteではなく,アリな~paletteたちが成す範囲である。 例えば,[ `stark black-on-white^en, `sepia dark-on-tan^en ]~schemeは、 どちらも,`明な色~scheme$と見なされる。 特定の色を保証するためには、 作者は,それらの色を自身で指定しなければナラナイ。 その帰結として、[ 既定の色や`~system色$【! `system-color$t 色】 ]と作者が指定した色が併用された場合, 特定0の~contrast~levelを保証できなくなることにも注意 — 判読能を確保するためには、 一般に,前景と背景の色を[ どちらも`~system色$にするか, どちらも手動で指定する ]ベキである。 `WCAG22$r ◎ Note: Light and dark color schemes are not specific color palettes, but a range of possible palettes. For example, a stark black-on-white scheme and a sepia dark-on-tan scheme would both be considered light color schemes. To guarantee specific colors, authors must specify those colors themselves. Note also that, consequently, pairing default or <system-color> colors with author-specified colors cannot guarantee any particular contrast level; to ensure legibility, generally either both foreground and background should be paired system colors or both be manually specified colors. [WCAG22]
利用者が`選好した色~scheme$は、 当の`~pageが~supportする色~scheme群$と組合され, `~pageの色~scheme@ を生産する。 `~pageの色~scheme$は、 それが既定の色~schemeであったか否かも,その`既定か$【!@】に記録される。 `~pageの色~scheme$は、 `媒体~query$ `prefers-color-scheme$d `MEDIAQUERIES-5$r で~query可能である。 ◎ The user’s preferred color scheme is then combined with the page’s supported color schemes to produce a page color scheme. The page color scheme also records whether it’s default or not. The page color scheme is queryable with the prefers-color-scheme media query. [MEDIAQUERIES-5]
`~pageが~supportする色~scheme群@ は、 ある`色~scheme~support$であり, どう設定されるかは文書~言語により定義される。
【 この段落は、 この訳による補完。 それに伴い,次の注記も他所からここへ移動した。 】
注記: `HTML$r においては、 `meta$e 要素のうち~metadata名として `color-scheme$v を伴うものが, `~pageが~supportする色~scheme群$を設定する。
【 その `content^a 属性の値の構文は, `color-scheme$p ~propと同じであり、 `color-scheme^p と同じ仕方で解釈されることになる。 】
個々の要素は、 `色~scheme@el を有する — それは、 既定では`~pageの色~scheme$に合致するが, `color-scheme$p ~propを利用して上書きできる。 要素の`色~scheme$elは、 次に挙げるものなどに影響する ( `§ 利用される色~schemeの効果$ を見よ): ◎ Individual elements have an element color scheme, which by default matches the page color scheme, but can be overriden using the color-scheme property. The element color scheme affects things such as\
- 当の要素における`~system色$の値 ◎ the value of system colors on the element,\
- 【当の要素に利用される】 `light-dark$f 関数の値 ◎ the value of the light-dark() function,\
- 【当の要素が表現する】~UI要素(~scrollbarなど)がどう描画されるか ◎ and how user interface elements (like scrollbars) render. (See § 2.4 Effects of the Used Color Scheme.)
~UAは,追加的な`色~scheme$を~supportしても`ヨイ^emが、 ~CSSは,【現時点では】そのような色~schemeの折衝を~supportしない。 ~UAは、[ `prefers-color-scheme$d, `color-scheme$p ]が追加的な値を反映できるよう,そのような~schemeの標準~化を追求するベキである。 ◎ User agents may support additional color schemes, however CSS does not support negotiation of additional color schemes: user agents should pursue standardization of these schemes, so that prefers-color-scheme and color-scheme can reflect the additional values.
注記: 色~schemeの~supportが存在する前に — したがって,【当時における】既定の色~scheme(`明な色~scheme$)を前提に — 著作された~pageは数多くあるので、 ~UAは,要素~内で利用される色を自身の制御の下で自動的に順応することはできない — そうすると,周囲の~pageとの色~contrastが読取n不能になりかねないので。 ~pageは、[ `~pageが~supportする色~scheme群$【!`~pageの色~scheme$】を設定する/ 個々の要素に `color-scheme$p ~propを手動で設定する ]ことにより,色~schemeの~supportを`~opt-inする必要^emがある。 ◎ Note: Because many pages were authored before color scheme support existed, and thus pages were authored with the assumption of the default (light) color scheme, user agents cannot automatically adapt the colors used in elements under their control, as it might cause unreadable color contrast with the surrounding page. Pages have to opt into color scheme support by setting the page color scheme, or manually setting the color-scheme property on individual elements.
2.1. 選好される色~schemeの~opt-in法
`~pageの色~scheme$ (それは、 `媒体~特能$ `prefers-color-scheme$d で~query可能である) は、 当の~page全般および[ `~pageの色~scheme$を `color-scheme$p ~propで特定的に上書きするもの ]を除くすべての要素~用に利用されることになる`色~scheme$を表現する。 `色~scheme$の効果についての全部的な記述は、 `§ 利用される色~schemeの効果$ を見よ。 ◎ The page color scheme represents the color scheme that will be used for the page overall (queryable with the prefers-color-scheme media feature) and for all elements that don’t specifically override the page color scheme with the color-scheme property. See § 2.4 Effects of the Used Color Scheme for a full description of what the color scheme effects. ◎ ↑↑ Note: In HTML, the color-scheme <meta> sets the page color scheme.
作者は、 一般に — 当の~pageを成す各~要素【の`色~scheme$el】を `prefers-color-scheme$d `媒体~特能$と一貫させるためには — `color-scheme$p ~propを利用するよりも, `~pageが~supportする色~scheme群$【!`~pageの色~scheme$】を設定する`ベキ^emである。 ◎ Authors should generally set the page color scheme, rather than using the color-scheme property, so that the prefers-color-scheme media feature is consistent with the elements on the page.
`~pageの色~scheme$は、 次を遂行した結果になる ⇒ `利用される色~schemeを決定する$( `選好される色~scheme$ ) ◎ The page color scheme is determined by finding the used color scheme, given the preferred color scheme and the page’s supported color schemes (a color scheme support).
埋込まれた文書 ( `iframe$e 内のそれや `img$e 要素で表現される~SVGなど) に`選好される色~scheme$には、 利用者の選好ではなく, 埋込んでいる要素の`色~scheme$elが利用される (それは、 通常の`色~scheme選好$ 【利用者が`選好した色~scheme$とは限らないもの】 として扱われる)。 ◎ In embedded documents (such as an iframe or an SVG img), the embedding element’s element color scheme is used as the embedded document’s preferred color scheme (treated as a normal color scheme preference), rather than the user’s preference.\
注記: これは、 埋込まれた文書が それを埋込んでいる【!the】[ ~page/要素 ]用に折衝された色~schemeに — 後者の【!parent】文書~内の他の要素と類似に — 合致することを許容する。 ◎ This allows embedded documents to match the negotiated color scheme for the page or an element, similar to other elements in the parent document.
ある~pageは、 利用者からの[ 明な/暗な ]表示~用の選好に応答して, 自身が利用する色を `prefers-color-scheme$d 媒体~特能を利用して改めているとする。 ~pageは、 単純な大域的な宣言で, ~browserが制御する~UI(~scrollbar, ~form入力, 等々)を合致させることを容易に~opt-inできる: ◎ A page that responds to user preferences for light or dark display by using the prefers-color-scheme media feature to alter the colors it uses can easily opt the browser-controlled UI (scrollbars, inputs, etc) to match with a simple global declaration:
<meta name=color-scheme contents="light dark">
(あるいは、 `~pageが~supportする色~scheme群$【!`~pageの色~scheme$】を直に設定する仕方が無い文書~言語【!言語】においては, 次の規則で:)
:root {
color-scheme: light dark;
}
◎
(Or, in languages that don’t have a way to set the page color scheme directly, a :root { color-scheme: light dark;} rule.)
~pageが `system-color$t `しか利用しない^emよう自身を制限している場合、 この `color-scheme$p 宣言は,利用者が選好した色~schemeを~supportすることになる — 作者は、 `media$at を利用する必要はまったくない。 ◎ If a page limits itself to using only the <system-color>s, the color-scheme declaration will support the user’s preferred color scheme even without the author needing to use @media at all.
ある~pageが銘柄や演出上の理由などから,すべての色~schemeを適度に収容できない場合でも、 ~pageは,[ `color-scheme$v / `color-scheme$p ]で[ どの色~schemeを`~supportできる^emか ]を指示でき, ~UIを それに合致させれる。 ◎ If a page cannot reasonably accommodate all color schemes, such as for branding or theatrical reasons, color-scheme or color-scheme can still indicate which color schemes the page can support, causing the UI to match.
当の~pageの色~schemeが首に明な場合、 次は,そのことを明示的に指示することになる: ◎ If the page’s color scheme is primarily light, the following will indicate that explicitly:
<meta name=color-scheme contents="light">
一方で,当の~pageは首に暗な場合、 次により そのことを明示的に指示すれば, ~pageの見かけは より首尾一貫したものになる: ◎ While if the page is primarily dark, indicating that explicitly will make the page look more coherent as well:
<meta name=color-scheme contents="dark">
もちろん、 どちらの色~schemeも~supportする方が良いが。 ◎ However, it is better to support both color schemes, of course.
2.2. ~pageの色~schemeの上書き法: `color-scheme^p ~prop
~pageは、 一般には,`~pageの色~scheme$を利用して利用する`色~scheme$を制御するベキであるが、 特定0の下位treeの`色~scheme$を上書きする必要があることも,ときにはある。 `color-scheme$p ~propは、[ 要素, その子孫 ]用に当の要素の`色~scheme$elを手動で設定することにより,これを許容する。 その値は、 当の要素が `~supportする色~scheme群@el — ある`色~scheme~support$ — を表現する【この用語および記述は,この訳による補完】。 ◎ While the page color scheme should generally be used to control what color scheme a page uses, occasionally there is need to override that color scheme on a particular subtree. The color-scheme property allows this, manually setting the element color scheme for an element and its descendants.\
各種~値は、 以下のとおり定義される: ◎ Values are defined as follows:
- `normal@v
- 当の要素の`色~scheme$elは、 `~pageの色~scheme$と同じになる。 【!(This includes noting whether the color scheme was defaulted.)】 ◎ The element color scheme is the same as the page color scheme. (This includes noting whether the color scheme was defaulted.)
- 当の要素が`~supportする色~scheme群$elは、 ~NULL になる。
- `light@v
- `dark@v
- 当の要素は[ `light^v が指定されたならば`明な色~scheme$/ `dark^v が指定されたならば`暗な色~scheme$ ]を~supportすることを指示する。 ◎ Indicates that the element supports a light and/or dark color scheme, as appropriate.\
- 当の要素が`~supportする色~scheme群$elは、 これらの~keywordを指定された順序で含むことになる。 ◎ The element’s color scheme support will include the keywords, in the order they’re specified.
- `only@v
- ~UAが当の要素~用の`色~schemeを上書きする$ことを禁止する。 ◎ Forbids the user agent from overriding the color scheme for the element.\
- 当の要素が`~supportする色~scheme群$elの`占有か$は ~T に設定されることになる。 ◎ The element’s color scheme support will have a flag indicating sole support.
- `custom-ident$t
- この値は無意味であり,将来の互換性を得る — 将来に色~schemeが追加されても、 旧来の~UAにおいて `color-scheme$p 宣言が無効~化されないようにする — ために限り存在する。 ~UAは、 どの `custom-ident^t 値も,意味があるものとは解釈しない`モノトスル^em — 認識される追加的な色~schemeは、 この~propの文法に明示的に追加されなければナラナイ。 ◎ <custom-ident> values are meaningless, and exist only for future compatibility, so that future added color schemes do not invalidate the color-scheme declaration in legacy user agents. User agents must not interpret any <custom-ident> values as having a meaning; any additional recognized color schemes must be explicitly added to this property’s grammar.
- 注記: 混同を避けるため、 著作~用の~tutorialや文献の素材からは `custom-ident$t を省略するベキである。 ◎ Note: To avoid confusion, authoring tutorials and references should omit <custom-ident> from their materials.
- 次に挙げる~keywordは、 この~propにおいては,妥当な `custom-ident$t でない ⇒ `normal$v, `light$v, `dark$v, `only$v ◎ The normal, light, dark, and only keywords are not valid <custom-ident>s in this property.
当の要素の`色~scheme$elは,次を遂行した結果になる ⇒ `利用される色~schemeを決定する$( 利用者が`選好した色~scheme$, 当の要素) ◎ If an element has any value other than color-scheme: normal, its element color scheme is determined by finding the used color scheme, given the user’s preferred color scheme and the element’s color scheme support specified by this property.
【 原文は,要素の `color-scheme$p が `normal$v をとる場合を除外しているが、 この訳では,その取扱いを利用される色~schemeを決定する~algoの中へ集約することにする。 】
ある~pageは、 複数の色~schemeを一般に取扱う能力があるが, 特定0の色~schemeで描画される必要がある下位節もあるかもしれない。 ◎ A page might be generally capable of handling multiple color schemes, while still having a sub-section that needs to be rendered in a particular color scheme.
例えば,ある~style手引きは、[ 明な色/暗な色 ]を利用して,いくつかの~UI例を与えることもあろう — [ 明な~theme/暗な~theme ]を特定的に見せつけるよう。 これは、 次で指示できる: ◎ For example, a style guide might give several UI examples that are using light or dark colors, showing off the light or dark theme specifically. This can be indicated as:
<meta name=color-scheme content="light dark">
<style>
.light-theme-example {
color-scheme: light;
}
.dark-theme-example {
color-scheme: dark;
}
</style>
下位節のうち[ `.light-theme-example^css / `.dark-theme-example^css ]を根とするものに限り,[ `明な色~scheme$/`暗な色~scheme$ ]を特定的に~opt-inすることになる — 当の~pageを成す残りは、 利用者の選好を尊重することになる。 ◎ Only the subsections rooted at .light-theme-example or .dark-theme-example will be opted into the light or dark themes specifically; the rest of the page will respect the user’s preference.
注記: `color-scheme$p にあてがう値は, `light light^v のように~keywordを繰返しても妥当であるが、 その効果は 1 個だけのときと同じになる。 ◎ Note: Repeating a keyword, such as color-scheme: light light, is valid but has no additional effect beyond what the first instance of the keyword provides.
2.3. 色~schemeの解決-法
利用者が選好した`色~scheme$を尊重することは,~pageにとって重要である一方、 当の~pageの作者が`期待する^em`色~scheme$に限って利用することも,重要である — さもなければ、[ 前景を成す要素, 背景を成す要素 ]の~contrastを不用意に極小にして~pageが読取n不能に描画されることが, ごく容易に生じる。 ◎ While it’s important for a page to respect the user’s preferred color scheme, it’s also important to only use a color scheme the page author expects, or else it is very easy to render a page unreadable by causing the foreground and background elements to accidentally have minimal (or zero!) contrast.
例えば,既定の明な色~schemeを期待している作者は、 ~pageの背景を淡い黄色に設定する一方で, ~textの色は — ~blackが既定で利用されることを期待して — 設定せずに済ませるかもしれない。 しかしながら、 当の~pageが利用者が選好した`暗な色~scheme$を予期せず~opt-inして, 既定の~text色を~whiteへ調整した場合、 ~textは ほとんど読取n不能になろう。 ◎ For example, an author expecting the default light color scheme might set the page background to a light cream while leaving the text color unset, expecting it to use the default black text color. If the page unexpectedly opted into a user’s preferred dark color scheme, however, and adjusted the default text color to white, that would make the text virtually unreadable.
これらの相反する懸念を埋め合わせるため、 `利用される色~scheme$【!利用される`色~scheme$】を生産する際には, 利用者の`色~scheme選好$が`~pageが~supportする色~scheme群$【!~pageの`色~scheme~support$】に対し比較される。 ◎ To balance these competing concerns, a user’s color scheme preference is compared against a page’s color scheme support to produce a used color scheme.
`色~scheme選好@ は、 次に挙げるいずれかをとる:
- `選好なし^i
- ある`色~scheme$(`明な色~scheme$/`暗な色~scheme$) 【を表現する~keyword ( `light$v / `dark$v )】
-
`上書きする色~scheme選好@ ⇒ 【ある`色~scheme$(を表現する~keyword)】
【 これが どこから利用されるかは,この仕様には述べられていないが、 `PreferenceManager@~MQ5#preferencemanager$I ~interfaceの `colorScheme@~MQ5#dom-preferencemanager-colorscheme$c 属性(が返す `PreferenceObject^I ~objの `requestOverride()^c ~method) `MEDIAQUERIES-5$r を通して利用されると見受けられる — その属性に述べられる要件を見よ (他にもあるかもしれないが)。 】
`色~scheme~support@ は、 次に挙げるいずれかをとる:
- ~NULL
- 1 個~以上の~supportされる`色~scheme$たちが成す~list。 この~listには、 真偽値をとる `占有か@ も結付けられ,他が指定されない限り ~F をとるとする。 ~T ならば,`もっぱら^em指示された`色~scheme$しか~supportしないことを指示する。
`利用される色~schemeを決定する@ ~algoは、 所与の ( `色~scheme選好$ %選好, 要素 %要素 ~DF ε ) に対し: ◎ To determine the used color scheme, given a color scheme support support and a color scheme preference preference:
-
%~support ~LET %要素 に応じて ⇒# ε ならば`~pageが~supportする色~scheme群$ / ~ELSE_ %要素 が`~supportする色~scheme群$el
【 原文の~algoは,`色~scheme~support$を引数にとるが、 この訳では,代わりに %要素 を引数にとるよう改める。 以下においても, %要素 が参照される段があるので。 】
- ~IF[ %~support ~EQ ~NULL ] ⇒ %~support ~SET 空な~list
- %~support から~UAが~supportしない`色~scheme$を除去する ◎ ↓
-
~IF[ %~support は空である ]:
-
~IF[ %要素 ~NEQ ε ] ⇒ ~RET `~pageの色~scheme$
【 この段は、 他所にて暗黙的に述べられた要件を集約するための,この訳による追加。 】
- %色~scheme ~LET ~UAの既定の`色~scheme$
- %色~scheme の `既定か@ ~SET ~T
- ~RET %色~scheme
-
- ~IF[ %選好 ~EQ `選好なし^i ] ⇒ ~RET %~support[ 0 ] ◎ If preference is no preference, return the first supported color scheme in support.
- ~IF[ %選好【!の`色~scheme$】 ~IN %~support ] ⇒ ~RET %選好【!の`色~scheme$】 ◎ If preference’s color scheme is in support and supported by the UA, return that color scheme.
- ~IF[ %~support の`占有か$ ~EQ ~T ] ⇒ ~RET %~support[ 0 ] ◎ If support is flagged as sole support, return the first supported color scheme in support.
-
~IF[ %選好 は`上書きする色~scheme選好$である ]:
- ~IF[ %要素 ~NEQ ε ] ⇒ %選好【!この`色~scheme$】 で %要素 の`色~schemeを上書きする$
- ~RET %選好【!の`色~scheme$】
- ~RET %~support[ 0 ] ◎ Otherwise, return the first supported color scheme in support.
注記: ここでの基本的な~logicは、 優先順に (以下においては、 ~UAは, %~support を成す どの色~schemeも~supportすると見做す):
- 当の~pageが色~schemeをまったく~opt-inしなかったならば ( %~support ~EQ ~NULL )、 おそらく,暗黙的に安全なものと設計された~UAの既定が利用される。
- 【 利用者が選好した色~schemeは無い場合( %選好 ~EQ `選好なし^i )、 %~support[ 0 ] が利用される。 】
- %選好 は %~support に含まれるならば、 %選好 が利用される。
- %~support の`占有か$ ~EQ ~T ならば、 %~support[ 0 ] が利用される。
- %選好 は`上書きする色~scheme選好$であるならば、 %選好 が利用される (加えて,これが実際に`働く^emことを確保するよう,当の要素の色は調整される)。
- %~support[ 0 ] が利用される。
注記:
~UAには、
特定0の`色~scheme$を~supportするよう要求されてはいない。
なので、
単独の~keywordを利用して要求される`色~scheme$を指示しても
— 例: `color-scheme$p: `dark^v —
要素の描画に何か効果を及ぼすことは保証されない。
◎
Note: User agents are not required to support any particular color scheme, so only using a single keyword, such as color-scheme: dark, to indicate a required color scheme is still not guaranteed to have any effect on the rendering of the element.
注記: これを書いた時点では、 ~UAは,`色~scheme選好$を成す選好~level【のうち一部】を実際には~supportしないかもしれない。 ~UAは、 一般に,普通の選好 — `明な色~scheme$か`暗な色~scheme$ — しか~supportしない。 それは、 上の~logicをかなり単純~化する。 ◎ Note: User agents might not actually support preference levels in a color scheme preferences. At the time of writing, UAs generally only support an ordinary light or dark preference, which considerably simplifies the above logic.
2.4. 利用される色~schemeの効果
~UAは、 どの要素に対しても, 次に挙げるものを当の要素の`色~scheme$elに合致させるベキである。 ◎ For all elements, the user agent must match the following to the element color scheme:
- ~scrollbarその他のヤリトリ~UIの既定の色 ◎ the default colors of scrollbars and other interaction UI
- ~form~controlや他の “特別に描画される” 要素の既定の色 ◎ the default colors of form controls and other "specially-rendered" elements
- “~spellcheck-underline” など,~browserが供する他の~UIの既定の色 ◎ the default colors of other browser-provided UI, such as "spellcheck" underlines
- `~system色$の値 ◎ the value of system colors
- `light-dark$f 関数の値 ◎ the value of the light-dark() function
`根~要素$に対しては、 その`色~scheme$elは,次に挙げるものにも影響するモノトスル ⇒# `~canvas$の表面~色, 表示域の~scrollbar ◎ On the root element, the element color scheme additionally must affect the surface color of the canvas, and the viewport’s scrollbars.
埋込まれた文書(~HTML `iframe$e 要素を介して供されるものなど)は、 概して,透明な`~canvas$上に描画される。 その事例において,期待される色~contrastを保全するためには、 ~UAは[ 当の要素【埋込んでいる要素】の`色~scheme$elが,埋込まれた文書の`根~要素$のそれと合致しない場合 ]には,透明の代わりに[ 不透明な,埋込まれた文書の根~要素の`色~scheme$elに適切な `Canvas$vS 色 ]を~canvasに利用するモノトスル。 この規則は、 ~graphic用に意図された要素を介して埋込まれた文書 (~SVG文書を埋込んでいる `img$e 要素など)には,適用されない — それらの~canvasは、 既定の透明であり続ける。 ◎ In order to preserve expected color contrasts, in the case of embedded documents typically rendered over a transparent canvas (such as provided via an HTML iframe element), if the element color scheme of the element and the element color scheme of the embedded document’s root element do not match, then the UA must use an opaque canvas of the Canvas color appropriate to the embedded document’s root element’s element color scheme instead of a transparent canvas. This rule does not apply to documents embedded via elements intended for graphics (such as img elements embedding an SVG document); their canvases remain the default transparent regardless.
注記: 上に挙げた数種の調整は別として、 一般に~UAは,利用者から選好された`色~scheme$に合致するよう~pageを更に調整することはない — ~pageが事故り易くなり過ぎるので。 しかしながら,利用者から特定0の色を選ぶよう要求された場合 (例えば,~accessibilityの理由から)、 より浸潤的な変更が適用されるかもしれない。 `§ 強制d色~palette@#forced$を見よ。 ◎ Note: Aside from the small list of adjustments given above, user agents generally do not further adjust a page to match the user’s preferred color scheme, because the chance of accidentally ruining a page is too high. However, when particular color choices are required by the user (for accessibility reasons, for example), more invasive changes might be applied; see § 3 Forced Color Palettes.
2.5. 色~schemeの上書き法
利用者が[ 作者が明示的に~supportしない特定0の色~scheme ]に対し`上書きする色~scheme選好$を指示していて, 作者が( `only$v ~keywordを利用しないことにより)それを許容している場合、 ~UAは, `色~schemeを上書きする@ モノトスル — すなわち: ◎ If the user has indicated an overriding preference for a particular color scheme that the author does not explicitly support, and the author has not disallowed this (by using the only keyword), the user agent must override the color scheme:\
- `§ 利用される色~schemeの効果$に述べられた効果に加えて、 他の色【次項に挙げるもの以外】も,この`上書きする色~scheme選好$【!選ばれた`色~scheme$】の中へ自動-調整するモノトスル — ~pageの可読性に必要yな色の~contrastを保全しながら,それらの明るさを反転するなどにより。 ◎ in addition to the effects described in § 2.4 Effects of the Used Color Scheme, it must also auto-adjust other colors into this chosen color scheme, such as by inverting their brightness, while preserving any color contrast necessary for readability of the page.\
- 次に挙げるものの中の色も適切に自動-調整してヨイ ⇒ `置換d要素$, 背景~画像, その他の外部の資源 ◎ In this case, UA may also auto-adjust colors within replaced elements, background images, and other external resources as appropriate.
注記: そのような自動-調整の仔細は、 ~UAにより定義され,~UAごとに相違し得る。 が、 すべての色を固定的な~paletteに強制することは意図されていない — `強制d色~mode$が強制するのは、 ~pageのすべての色を[ `暗な色~scheme$/`明な色~scheme$ ]に適合させることに限られるので。 ◎ Note: The specifics of such auto-adjustments are UA-defined, and can differ from UA to UA. But it is not intended to force all colors into a fixed palette, as forced colors mode does, only to force all colors on the page to conform to either a dark or light color scheme.
例えば、 ~UAには,[ すべての~pageを`暗な色~scheme$に強制する ]ような[ “暗な部屋” 用の~mode ]が有るかもしれない。 この~modeは: ◎ For example, a UA might have a “dark room” mode, which forces all pages into a dark color scheme.
- 当の~pageが[ 要素が`~supportする色~scheme群$el( `color-scheme$p )/ `~pageが~supportする色~scheme群$( `color-scheme$v ) ]を利用して,`暗な色~scheme$を~supportすることを明示的に指示した場合 ⇒ `prefers-color-scheme$d `媒体~query$に対しては【その`実~値$】 `dark$vM を報告して, `利用される色~scheme$として`暗な色~scheme$を選定すること以外には、 効果は無い。 ◎ For pages that already support dark color schemes, and have indicated so using the color-scheme property or color-scheme meta name, this has no effect other than reporting a dark value for the prefers-color-scheme media query and selecting a dark used color scheme.
- 他の場合 ⇒ ~pageの色に対する自動-調整を誘発して, ~pageが欲された`暗な色~scheme$に適合するよう`強制する^em — `color-scheme$p に `only light^v を指定することにより, この自動-調整が明示的に禁止された要素を除き。 ◎ But for pages that do not explicitly support a dark color scheme, and have not explicitly forbidden this auto-adjustment by specifying color-scheme: only light, this mode triggers auto-adjustment of the page’s colors to force the page to conform to the desired dark color scheme.
3. 強制d色~palette
`強制d色~mode@ は、[ 色~contrastを通して~textの可読性を高める ]ために意図される~accessibility特能である。 個々の弱視者は、[ 前景~色, 背景~色 ]に特定0の型の~contrastがある方が,内容を読取るのが快適になると見出すことが多い。 ◎ Forced colors mode is an accessibility feature intended to increase the readability of text through color contrast. Individuals with limited vision often find it more comfortable to read content when there is a particular type of contrast between foreground and background colors.
~OSは、 組込みの色~themeを供せる — Windows の高~contrastな[ `black-on-white^en / `white-on-black^en ]~themeなど。 利用者はまた、 自前の~themeを~customizeできる — 例えば、 低~contrastや色相~contrastを供するように。 ◎ Operating systems can provide built-in color themes, such as Windows’ high contrast black-on-white and high-contrast white-on-black themes. Users can also customize their own themes, for example to provide low contrast or hue contrast.
`強制d色~mode$においては、 ~UAは,利用者が選好した色~paletteを~page上で施行して,作者が特定の~prop用に選んだ色を上書きする — `§ 強制d色~modeに影響される~prop@#forced-colors-properties$を見よ。 また、 可読性に必要十分な~contrastを確保するため, ~textの~~背後に “裏板” を施行することもある ( `selection$pe 疑似要素に対し背景が塗られる仕方に類似する)。 ◎ In forced colors mode, the user agent enforces the user’s preferred color palette on the page, overriding the author’s chosen colors for specific properties, see § 3.1 Properties Affected by Forced Colors Mode. It may also enforce a “backplate” underneath text (similar to the way backgrounds are painted on the ::selection pseudo-element) to ensure adequate contrast for readability.
~pageが`強制d色~mode$に順応することを可能化するため、 ~UAは,それを `forced-colors$d 媒体~queryに合致させることになる 【すなわち,その`実~値$は、強制d色~modeの有無を反映する値をとる】 — ~UAは、 要求された色~paletteを`~system色$( `CSS-COLOR-4$r )を通して供するモノトスル。 加えて,~UAは、 ~Lab明度に基づく `Canvas$vS 色が明瞭に[ 暗なもの( L ~LT 33% )/明なもの( L ~GT 67% ) ]と決定した場合には、 `prefers-color-scheme$d 媒体~queryの適切な値に合致させ, `color-scheme$p 用の対応する利用者-選好を表出するモノトスル。 これにより,[ 明な/暗な ]色~schemeを~supportする~pageは、 強制d色~schemeにより近く合致するよう自動的に調整できるようになる。 上の[ 明な, 暗な ]の境目をどこにおくかは,~UAにより定義され、 利用者から選好された`色~scheme$としての結果は,[ `light^v, `dark^v ]のいずれにも見做され得ることに注意。 ◎ To enable pages to adapt to forced colors mode user agents will match the forced-colors media query and must provide the required color palette through the CSS system colors (see [CSS-COLOR-4]). Additionally, if the UA determines, based on Lab lightness, that the Canvas color is clearly either dark (L < 33%) or light (L > 67%), then it must match the appropriate value of the prefers-color-scheme media query and express a corresponding user preference for color-scheme. This will allow pages that support light/dark color schemes to automatically adjust to more closely match the forced color scheme. Behavior between the above dark vs. light thresholds is UA-defined, and may result in assuming either light or dark as the user’s preferred color scheme.
~UAは、 【`§ 模倣@#color-adjust-emulation$の目的においては,】 `模倣された強制d色~themeの~dataを取得する$の結果が `none$l でない場合には、 上述した~OS色~themeを素通りして,代わりに[ 利用者が[ 当の結果~用に定義された`強制d色~mode用の模倣~色~palette$ ]で`強制d色~mode$を可能化した ]かのように動作するベキである。 ◎ If get emulated forced colors theme data is not "none", the user agent should bypass the above operating system color themes, and instead act as if the user has enabled forced colors mode with the forced colors mode emulation color palette defined for the resulting value of emulated forced colors theme data.
3.1. 強制d色~modeに影響される~prop
[ `強制d色~mode$が作動中にある ]かつ[ 要素の `forced-color-adjust$p は `auto$vF をとる ]ときは(下を見よ)、 当の要素の すべての~propの `color$t 成分は,[ 利用者から選好された色~palette ]に強制的に調整される。 ◎ When forced colors mode is active and forced-color-adjust is auto (see below) on an element, the <color> components of all properties on the element are force-adjusted to the user’s preferred color palette.
注記: これを書いた時点では、 `強制d色~mode$は, 特定的には次に挙げる~propに適用される — 各自の略式~propも含めて。 この~listは網羅的とは限らない — 時間~越しに他の~propも追加され得るので: ◎ Specifically, forced colors mode applies to the following color properties, along with their shorthands. This is the list of color properties existing at the time of writing, but it may not be an exhaustive list as more properties get added over time:
- `accent-color$p
- `background-color$p
- `border-color$p
- `caret-color$p
- `color$p
- `flood-color$p
- `fill$p
- `lighting-color$p
- `outline-color$p
- `rule-color$p
- `scrollbar-color$p
- `stop-color$p
- `stroke$p
- `text-decoration-color$p
- `text-emphasis-color$p
- `-webkit-tap-highlight-color^p
~propの `color$t 成分 %成分 の`使用~値$は、 %成分 の`算出d値$が`~system色$以外になる場合でも, 次に従って得られる`~system色$に強制される: ◎ For each <color> component of a property, if its computed value is a color other than a system color, its used value is instead forced to a system color as follows:
- ~IF[ 当の~propは `background-color$p である ] ⇒ ~RET [ `color$p ~propに対し,この手続きを適用して得られる`~system色$ ]に対する,`~system色の~pair法$を成すもう片方の色 — ただし ⇒# `Canvas$vS に対する もう片方の色には `CanvasText$vS を利用する/ 透明な背景はそうあり続けるよう、その~alpha~channelは %成分 の`算出d値$から採る ◎ For background-color in particular, it is forced to the color opposite the color property’s system color value in the system color pairings, using CanvasText as the opposite of Canvas. However, its alpha channel is taken from the original background-color value so that transparent backgrounds remain transparent.
-
~RET ~UAが決定する適切な`~system色$ — それは、[ 要素の影響される~propすべてが,~UAにより同様に決定される ]とするとき,[ `作者~stylesheet$は空であったとするときの結果の色 ]に合致するベキである。 【再帰を孕む妙に回りくどい言い回しだが、要するに, “作者が指定した~styleは、結果の色に影響しないベキである” と解釈できよう。】 ◎ In all other cases, the UA determines the appropriate forced system color—which should match the color that would result from an empty author style sheet whenever all of the element’s affected properties are likewise UA-determined.
注記: ~UAは、 色を強制する際に,継承について気を付ける必要がある。 例えば,~UAの~buttonと~canvasとでは、 その[ `color$p, `background-color$p ]どちらの~propも,互いに~~反対色にされているとする。 次の~markupが与えられたとき: ◎ UAs need to be careful about inheritance when forcing colors. For example, suppose the UA’s button color and background-color are the opposite of its canvas color and background-color. Given markup such as
<button>この<em>~button</em>を押せ</button>
`em$e は、 通常は, `button$e から継承して自身の可読性を確保することになる。 しかしながら,`強制d色~mode$においては、 `button$e, `em$e どちらの `color$p も強制される必要がある。 `button$e の色が~button用の色に強制されるベキであるのは容易にわかるが、 `em$e もまた,~button用の色に強制される必要がある — 文書~内の他所と同様に~canvasの `color$p に強制されたとする場合、 その~textは読取n不能になるので。 ◎ Normally, em will inherit from button, ensuring its readability. However in forced colors mode, the color of both button and em will need to be forced. It’s easy to see that button’s color should be forced to the button color, but em also needs to be forced to the button color; if it were forced to the canvas color like it is everywhere else in the document, its text will be unreadable.
加えて: ◎ Additionally:
- `box-shadow$p は `none^v に算出される。 ◎ ↓
- `text-shadow$p は `none^v に算出される。 ◎ box-shadow and text-shadow compute to none
- `background-image$p は、 元の値が `url$f 関数を包含していないならば, `none^v に算出される。 ◎ background-image computes to none unless the original value contains a url() function
- `color-scheme$p は `light dark^v に算出される ◎ color-scheme computes to light dark
- `scrollbar-color$p は `auto^v に算出される ◎ scrollbar-color computes to auto
- `accent-color$p は `auto^v に算出される ◎ accent-color computes to auto
- `font-variant-emoji$p が[ `normal^v / `unicode^v ]に算出される場合、 ~UAは,その`算出d値$を `text^v に強制するベキである — 当の~page上の【当の~propが適用される~textを成す】どの絵文字も, その単彩色な変種が可用なら それを利用するよう【!重複:force】。 ◎ If font-variant-emoji computes to normal or unicode, UAs should force any emoji on the page to its monochrome variant, if available, by forcing the computed value of font-variant-emoji to text.
~UAは、 より良い利用者~体験を供するためとして,これらの`強制d色~mode$用の経験則を更に手直ししてもヨイ。 ◎ UAs may further tweak these forced colors mode heuristics to provide better user experience.
作者は、 `強制d色~mode$においても, `color-mix$f などの特能を利用できる。 そのような事例では、 `算出d値$は通常通り挙動することになるが, `使用~値$は適切な`~system色$で上書きされることになる。 ◎ Authors may still use features such as color-mix() in forced colors mode. In such cases, the computed value will behave as it would normally, but the used value will be overridden with an appropriate system color.
.example {
color: color-mix(in srgb, CanvasText, Canvas);
}
`color$p 用の`算出d値$は、 2 つの`~system色$[ `CanvasText$vS, `Canvas$vS ]を 50% ずつ混色した結果になる。 その値は、 子孫へ継承され, `computedStyleMap()@~CSSTOM1#dom-element-computedstylemap$c などの~APIを介して観測-可能になる。 ◎ The computed value for color will be a 50-50 blend of the CanvasText and Canvas system colors. That value will inherit to descendants and be observable via APIs such as computedStyleMap().
`color$p 用の`使用~値$は、 ~UAが選んだ`~system色$ — 例えば `CanvasText$vS — になる。 ◎ The used value for color will be a system color chosen by the UA, for example CanvasText.
3.2. 強制d色~paletteの~opt-out法: `forced-color-adjust^p ~prop
`forced-color-adjust$p ~propは、 次を作者に許容する ⇒ 特定0の要素に対し、 `強制d色~mode$を~opt-outして【~~任意で外して】,色に対する全部的な制御を~CSSに戻す ◎ The forced-color-adjust property allows authors to opt particular elements out of forced colors mode, restoring full control over the colors to CSS.\
各種 値の意味は: ◎ Values have the following meanings:
- `auto@vF
- 要素の色は、 `強制d色~mode$において,~UAにより自動的に調整される。 ◎ The element’s colors are automatically adjusted by the UA in forced colors mode.
- `none@vF
- 要素の色は、 `強制d色~mode$において,~UAにより自動的に調整されない。 ◎ The element’s colors are not automatically adjusted by the UA in forced colors mode.
- 作者は、 この値を利用するのを,次に該当するときに限るベキである ⇒ 利用者が必要とする[ 色, ~contrast ]を~supportするために,自身で色を調整していて、 当の要素~用に もっと適切な利用者~体験を供するよう,~UAによる既定の調整に対し変更を為す必要がある。 ◎ Authors should only use this value when they are themselves adjusting the colors to support the user’s color and contrast needs and need to make changes to the UA’s default adjustments to provide a more appropriate user experience for those elements.
- `preserve-parent-color@vF
- `強制d色~mode$において,親から `color$p ~propを継承する場合 (すなわち,要素の`~cascaded値$は、 無いか[ `currentcolor$v / `inherit$v / 親から継承する別の~keyword ]である)、 `color$p ~propの`算出d値$は親の `color$p の`使用~色$になる。 ◎ In forced colors mode, if the color property inherits from its parent (i.e. there is no cascaded value or the cascaded value is currentColor, inherit, or another keyword that inherits from the parent), then it computes to the used color of its parent’s color value.
- 他のすべてに関しては,`none^v と同じに挙動する。 ◎ In all other respects, behaves the same as none.
- 注記: この値は、 もっぱら次が意図される ⇒ 埋込まれた~SVG要素のうち,~text色を外縁~文書から受取ることを期待するものが、 適度な挙動を取得する (および`強制d色~mode$による調整と一貫させる) 一方で、 他では,~SVGの正確な色を既定で保全する — `強制d色~mode$は、 一般に,~~絵図には有用に適用し得ないので。 ◎ Note: This value is intended solely to get a reasonable behavior from embedded SVG elements that expect to receive the outer document’s text color (and stay consistent with adjustments from forced colors mode), while otherwise defaulting SVGs to preserving their exact colors, as forced colors mode can’t generally be usefully applied to illustrations.
~SVG内容を非互換化しないよう、 ~UAには,[ 自身の~UA~stylesheetに,次の規則を追加する ]ことが期待される: ◎ In order to not break SVG content, UAs are expected to add the following rules to their UA style sheet:
@namespace "http://www.w3.org/2000/svg";
svg|svg { forced-color-adjust: preserve-parent-color; }
svg|foreignObject { forced-color-adjust: auto; }
~UAは、 `根~要素$に設定された `forced-color-adjust$p 値を文書の表示域へ伝播させるモノトスル (例えば~canvasの背景など、それが影響し得る所では)。 `forced-color-adjust^p は、 ~HTML `body$e 要素からは`伝播しない^emことに注意。 ◎ UAs must propagate the forced-color-adjust value set on the root element to the document viewport (where it can affect e.g. the canvas background). Note that forced-color-adjust is not propagated from HTML body.
4. 処理能に基づく色~調整
ほとんどの~monitor上では,作者が何~色を選ぼうが、 機器がどう描画するかに関して,有意な相違が生じることはない。 文書の背景が~white/~blackどちらであろうが,表示する容易さは ほぼ等しい。 ◎ On most monitors, the color choices that authors make have no significant difference in terms of how the device performs; displaying a document with a white background or a black background is approximately equally easy.
しかしながら、 この前提が成り立たないような機器も中にはあり,制限があったり, 品質が変わることがある。 例えば,印刷機は白い紙に印刷する傾向にあるので、 背景が白い文書では,~inkを費やすことなく背景を描く一方で、 背景が黒い文書では,背景~色を埋めるために多量の~inkを費やす。 これは、 印刷費を跳ね上げるのは言うまでもなく,紙に有害な物理-効果をもたらすこともある。 ~text色を[ 黒にするか暗な~grayにするか ]のような,さほど違いはない場合でも、 印刷-時には まったく異なることはある — 利用する~inkを単独の黒~inkから[ ~cyan, ~magenta, ~yellow ]~inkの混合に切替えるので、 ~inkを余計に費やしたり解像度が低下する。 ◎ However, some devices have limitations and other qualities that make this assumption untrue. For example, printers tend to print on white paper; a document with a white background thus has to spend no ink on drawing that background, while a document with a black background will have to expend a large amount of ink filling in the background color. This tends to look fairly bad, and sometimes has deleterious physical effects on the paper, not to mention the vastly increased printing cost from expending the extra ink. Even fairly small differences, such as coloring text black versus dark gray, can be quite different when printing, as it switches from using a single black ink to a mixture of cyan, magenta, and yellow ink, resulting in higher ink usage and lower resolution.
その結果,一部の状況下では、 ~UAは[ 特定0の文脈において,作者が指定した~styleを改める ]こともある — それらを出力~機器~用に より適切に調整して,利用者が選好すると見做されるものを収容するよう。 しかしながら,文書が[ 利用者に快適aになるよう,重要かつ熟慮された仕方で色を利用している ]事例もあり、 そのような~pageでは,[ 選ばれた色を尊重するよう,何らかの仕方で~UAに~hintする ]ことが求まれるであろう。 `color-adjust$p ~propは、 これを制御する。 この節では、 これらの自動的な調整を制御するための~propを定義する。 ◎ As a result, in some circumstances user agents will alter the styles an author specifies in some particular context, adjusting them to be more appropriate for the output device and to accommodate what they assume the user would prefer. However, in some cases the document may be using colors in important, well-thought-out ways that the user would appreciate, and so the document would like some way to hint to the user agent that it might want to respect the page’s color choices. This section defines properties for controlling these automatic adjustments.
4.1. ~inkの~~節約: `print-color-adjust^p ~prop
`print-color-adjust$p ~propは、 所与の[ 印刷機や,それに類似な機器 ]において[ 高価に,より一般には無分別に ]なり得るときに(例:暗な背景に明な~textを利用するなど),[ 色や~styleの~~選択をどう扱うべきか ]についての~hintを~UAに供する。 ~UAは、[ 文書~表示を成す この側面を制御すること ]を利用者に許容する場合には,[ この~propが供する~hintより,利用者-選好を強く尊重する ]モノトスル。 とり得る値は: ◎ The print-color-adjust property provides a hint to the user-agent about how it should treat color and style choices that might be expensive or generally unwise on a printer or similar device, such as using light text on a dark background. If user agents allow users to control this aspect of the document’s display, the user preference must be respected more strongly than the hint provided by print-color-adjust. It has the following values:
- `economy@v
- ~UAは、 ~pageの~style付けに対し,[ 出力~機器に必要かつ賢明と判断される調整 ]を施すべきである。 ◎ The user agent should make adjustments to the page’s styling as it deems necessary and prudent for the output device.
- 例えば,文書が印刷されるとき、 ~UAは,費やす~ink量を~~抑えるために[ 背景を無視して,~textを十分~暗な色になるよう調整する ]こともあり得る。 ◎ For example, if the document is being printed, a user agent might ignore any backgrounds and adjust text color to be sufficiently dark, to minimize ink usage.
- `exact@v
- この値は、 次を指示する ⇒ 当の~pageは,[ 重要かつ有意な仕方で,要素の色や~style付けを指定している ]ので、[ 利用者から要請されない限り,手直しされたり変更されるべき ]でない。 ◎ This value indicates that the page is using color and styling on the specified element in a way which is important and significant, and which should not be tweaked or changed except at the user’s request.
- 例えば、 方向指示( `printed directions^en )を提供している地図siteは、 方向指示の背景を[ ~whiteと明な~grayが交互に並ぶ “縞模様” ]にするかもしれない。 背景を純~whiteにすると、 この縞模様は失われ,[ ~~車の~~運転時に方向指示を~~一目で読み取る ]のは難しくなる。 ◎ For example, a mapping website offering printed directions might "zebra-stripe" the steps in the directions, alternating between white and light gray backgrounds. Losing this zebra-striping and having a pure-white background would make the directions harder to read with a quick glance when distracted in a car.
~UAは、 `根~要素$に設定された `print-color-adjust$p 値を文書の表示域へ伝播させるモノトスル (例えば,~canvasの背景など、それが影響し得る所では)。 `print-color-adjust^p は、 ~HTML `body$e 要素からは`伝播しない^emことに注意。 ◎ UAs must propagate the print-color-adjust value set on the root element to the document viewport (where it can affect e.g. the canvas background). Note that print-color-adjust is not propagated from HTML body.
4.2. `color-adjust^p 略式~prop
`color-adjust$p 略式~propは、[ 色~調整~propのうち,処理能が動機にあるものすべて ]を 1 個の宣言で設定することを作者に許容する。 (該当する~propは,現時点では `print-color-adjust$p しかないが、 将来には,もっと追加されるかもしれない。) ◎ The color-adjust shorthand allows an author to set all of the performance-motivated color adjustment properties in one declaration. (Currently, there is only one such property—print-color-adjust—but more might be added in the future.)
`color-adjust$p は、 現時点では,`非推奨dである^em。 作者は、[ 意図された以外の文脈における,処理能に基づく色~調整 ]を[ 不用意に設定し直すのを避ける ]よう,より特定な `print-color-adjust$p ~propを利用するベキである。 ◎ The color-adjust shorthand is currently deprecated. Authors should use the more specific print-color-adjust property, to avoid accidentally resetting performance-based color adjustments in other contexts than the one intended.
5. 模倣
この文書は、[ ~UAを自動化する目的, ~appを~testする目的 ]で,以下に与える模倣を定義する。 ◎ For the purposes of user agent automation and application testing, this document defines the below emulations.
5.1. 強制d色~modeを模倣する
各`~top-level辿可能$には、 `模倣された強制d色~themeの~data@ が結付けられる — それは `ForcedColorsModeAutomationTheme$I を表現している~dataであり, 初期~時は `none$l とする。 ◎ Each top-level traversable has an associated emulated forced colors theme data, which is data representing ForcedColorsModeAutomationTheme, initially "none".
enum `ForcedColorsModeAutomationTheme@I {
`none@l,
`light@l,
`dark@l
};
【 ~IDL列挙~型が利用されているが、 何の~APIに利用されるのか述べられていない (なぜ,これらの文字列~値を~IDLにより定義する必要があるのか不明)。 】
`模倣された強制d色~themeの~dataを設定する@ ~algoは、 所与の ( `~navigable$ %~navigable, %模倣された~theme~data ) に対し: ◎ To set emulated forced colors theme data, given navigable navigable and an emulatedThemeData:
- ~Assert: %模倣された~theme~data は `ForcedColorsModeAutomationTheme$I である。 ◎ Assert emulatedThemeData is ForcedColorsModeAutomationTheme.
- %辿可能 ~LET %~navigable の`~top-level辿可能$nav ◎ Let traversable be navigable’s top-level traversable.
- ~IF[ %辿可能 ~NEQ ~NULL ] ⇒ %辿可能 の`模倣された強制d色~themeの~data$ ~SET %模倣された~theme~data — ~UAは、 これを~styleの再計算を要求する変化と見なすモノトスル。 ◎ If traversable is not null: • Set traversable’s associated emulated forced colors theme data to emulatedThemeData. • UAs must consider this a change that requires style recalculation.
`模倣された強制d色~themeの~dataを取得する@ ~algoは、 所与の ( `ForcedColorsModeAutomationTheme$I %~theme ) に対し: ◎ To get emulated forced colors theme data, given ForcedColorsModeAutomationTheme theme:
-
%~navigable ~LET %~theme に`関連な大域~obj$に`結付けられた文書$の`~node~navigable$
【 %~theme は列挙~型の値なので、 関連な大域~objは定義されない。 この~algoは、 当の文書も引数にとるよう改められるべきであろう。 】
◎ Let navigable be theme’s relevant global object’s associated Document’s node navigable. - ~IF[ %~navigable ~EQ ~NULL ] ⇒ ~RET ~NULL ◎ If navigable is null, return null.
- %辿可能 ~LET %~navigable の`~top-level辿可能$nav ◎ Let traversable be navigable’s top-level traversable.
- ~IF[ %辿可能 ~EQ ~NULL ] ⇒ ~RET ~NULL ◎ If traversable is null, return null.
- ~RET %辿可能 の`模倣された強制d色~themeの~data$ ◎ Return traversable’s associated emulated forced colors theme data.
5.2. 強制d色~mode用の色~palette
この文書は、[ ~UAを自動化する目的, ~appを~testする目的 ]で,以下に与える `強制d色~mode用の模倣~色~palette@ を定義する。 ◎ For the purposes of user agent automation and application testing, this document defines the below forced colors mode emulation color palettes.
| ~keyword | `light$l 用の値 | `dark$l 用の値 |
|---|---|---|
| `AccentColor$vS | `#FFFFFF^vC | `#000000^vC |
| `AccentColorText$vS | `#000000^vC | `#FFFFFF^vC |
| `ActiveText$vS | `#00009F^vC | `#FFFF00^vC |
| `ButtonBorder$vS | `#000000^vC | `#000000^vC |
| `ButtonFace$vS | `#FFFFFF^vC | `#000000^vC |
| `ButtonText$vS | `#000000^vC | `#FFFFFF^vC |
| `Canvas$vS | `#FFFFFF^vC | `#000000^vC |
| `CanvasText$vS | `#000000^vC | `#FFFFFF^vC |
| `Field$vS | `#FFFFFF^vC | `#000000^vC |
| `FieldText$vS | `#000000^vC | `#FFFFFF^vC |
| `GrayText$vS | `#600000^vC | `#3FF23F^vC |
| `Highlight$vS | `#37006E^vC | `#1AEBFF^vC |
| `HighlightText$vS | `#FFFFFF^vC | `#000000^vC |
| `LinkText$vS | `#00009F^vC | `#FFFF00^vC |
| `Mark$vS | ||
| `MarkText$vS | ||
| `SelectedItem$vS | `#37006E^vC | `#1AEBFF^vC |
| `SelectedItemText$vS | `#FFFFFF^vC | `#000000^vC |
| `VisitedText$vS | `#00009F^vC | `#FFFF00^vC |
~privacyの考慮点
[ `色~scheme$/`強制d色~mode$ ]を介して利用者の色~選好を適用した場合、 その選好は `getComputedStyle()$c を介して~pageに公開されるので, 指紋収集~表口が広がり得る。 ◎ Applying user color preferences via color schemes or forced colors mode exposes the user’s color preferences to the page via getComputedStyle(), which can increase fingerprinting surface.
注記: あいにく,これを避けることには、 無視するわけにいかないと判断される欠点もついて来る — すなわち: ◎ Avoiding this comes with unfortunate drawbacks that were deemed too significant to be ignored. Namely:
- `~system色$を[ `実際の値$の時点まで,~keywordとして保全する ]と、 有意な量の配備-済みな~scriptを非互換化することになる — `color$p の初期~値は、 すでに,~system色なので (その一方、 `color$p からは~RGB色が得られるものと暗黙的に期待する~scriptは,大量にある)。 ◎ preserving system colors as keywords until actual-value time would break a significant amount of deployed script, as the initial value of color is a system color already (but a huge amount of script implicitly expects to see an RGB color from color)
- ~script用の~APIが`~system色$について嘘をつく (常に,何らかの静的な値であるよう装う)と、 ~script内で,それに基づいて計算された色は、 `実際の^em~system色が利用されるとき,読取n不能になりかねない。 ◎ lying about system colors from the scripting APIs (pretending they’re always some static values) can result in any colors calculated from page colors in script being unreadable when used with the actual system colors.
この論題についての論点は `5710$issue を見よ。 ◎ See Issue 5710 for discussion on this topic.
埋込まれた文書は、 (非同一-生成元な文書であっても) それを埋込んでいる要素の`色~scheme$elを自身の`選好される色~scheme$として受取る — それは、 技術的には,ちょっとした非同一-~site通信を成す。 このことは、 ~browser~securityの考査者からは,有意な問題とは見なされなかった。 加えて、 埋込まれた文書 — 特に,~SVG画像 — が親~pageの色~schemeに自動的に順応するようになることは, ~page利用者の便益を請合う価値が十分【!enought】にあるものと見なされた。 ◎ Embedded documents (even cross-origin ones) recieve their embedding element’s element color scheme as their preferred color scheme, which is technically a bit of cross-site communication. This was not considered a significant problem by browser security reviewers, and the user benefit of having pages and, particularly, SVG images automatically adapt to the parent page’s color scheme was considered valuable enought to warrant it.
~securityの考慮点
埋込まれた文書 %文書 にとっては、 計時~攻撃を利用して,[ %文書, %文書 を埋込んでいる `iframe$e ]の `color-scheme$p が合致するかどうか決定することもアリになり得る。 ◎ It may be possible for an embedded document to use timing attacks to determine whether its own color-scheme matches that of its embedding iframe or not.
謝辞
この仕様は、[ Apple, Google, Microsoft, および www-style における印刷~調整についての論点 ]による[ 色~調整の様々な特能に対する開発 ]の労なくしてはアリでなかった。 特に,~CSS~WGは、 次の方々に感謝したい ⇒ `François Remy^en, イアンフェッティ ◎ This specification would not be possible without the development efforts of various color adjustment features at Apple, Google, and Microsoft as well as discussions about print adjustments on www-style. In particular, the CSS Working Group would like to thank: François Remy, イアンフェッティ
ここに[ MSFT / Apple / Google ]の方々を追加的に挙げる。 ◎ List additional MSFT / Apple / Google people here.
変更点
- `2022年 2月 10日 勧告候補~snapshot@~TR/2022/CR-css-color-adjust-1-20220210/$ からの変更点 ◎ Changes since the 10 February 2022 Candidate Recommendation Snapshot:
- `color$f 用の~fallback~system色に対する特別な取扱いを除去した — その特能は `CSS-COLOR-4$r から除去されたので。 ( `7007$issue ) ◎ Removed special handling of color() fallback system colors, since the feature was removed from [CSS-COLOR-4]. (Issue 7007)
- `強制d色~mode$の~test法を改善するため、 模倣~supportを追加した。 ( `11824$issue ) ◎ Added emulation support for improved testing of forced colors mode. (Issue 11824)
- `強制d色~mode$が適用される対象を[ 特定の既知な~propたち ]から より汎用~的に[ すべての~propの `color$t 成分 ]へ更新した。 それに伴い,それらの~propを注記へ移動した。 ( `11857$issue ) ◎ Updated the properties that apply in forced colors mode to more generically apply to the <color> components of all properties, with specific known properties moved to a note. (Issue 11857)
- `強制d色~mode$用の~font絵文字~fallback~logicを追加した。 ( `8064$issue ) ◎ Added font emoji fallback logic for forced colors mode. (Issue 8064)
上述した勧告候補までの `変更点@~TR/2022/CR-css-color-adjust-1-20220210/#changes$も見よ。 【便宜のため、それらの日本語訳も以下に与える。】 ◎ See also Changes prior to Candidate Recommendation.
- `2021年 6月 16日 作業草案@~TR/2021/WD-css-color-adjust-1-20210616/$ からの変更点: ◎ Changes since the 16 June 2021 Working Draft:
- `color-scheme$p 用の値 `normal$v は、 ~HTMLにより `meta$e ~tagで~hook可能になるよう定義した。 ◎ Defined color-scheme: normal to be hookable by HTML with a meta tag.
- `2020年 11月 9日 作業草案@~TR/2020/WD-css-color-adjust-1-20201109/$ からの変更点: ◎ Changes since the 9 November 2020 Working Draft:
- `強制d色~mode$により設定し直される~propとして,次に挙げるものを追加した ( `5778$issue, `5873$issue, `5987$issue ) ⇒# `scrollbar-color$p, `caret-color$p, `flood-color$p, `lighting-color$p, `stop-color$p, `accent-color$p ◎ Added scrollbar-color, caret-color, flood-color, lighting-color, stop-color, and accent-color resets to forced colors mode. (Issue 5778, Issue 5873, Issue 5987)
- `color-adjust$p を `print-color-adjust$p に改称した。 それに伴い, `color-adjust$p を[ 別名/略式 ]~propとして追加し直した ( `3880$issue ) ◎ Renamed color-adjust to print-color-adjust, and re-added color-adjust as an alias/shorthand. (Issue 3880)
- `forced-color-adjust$p に `preserve-parent-color$vF ~keywordを追加した上で、 それを利用するよう【~UA】~stylesheetを調整した — 一般的な “~SVG色は弄らない” 挙動を,~SVG~iconの様な[ `強制d色~mode$が効果を`発揮した後^emに,継承された~text色を利用する ]よう求める利用事例を非互換化することなく保全するため。 ( `6310$issue ) ◎ Added the preserve-parent-color keyword to forced-color-adjust and adjusted the stylesheet to use it, to preserve the general "don’t mess with SVG colors" behavior without breaking use-cases like SVG icons that want to use the inherited text color after forced colors mode has taken effect. (Issue 6310)
- `2020年 4月 2日 作業草案@~TR/2020/WD-css-color-adjust-1-20200402/$ からの変更点 ◎ Changes since the 2 April 2020 Working Draft:
- `color-scheme$p ~prop用の `only^v ~keywordを除去した。 ( `3881$issue ) ◎ Removed the only keyword. (Issue 3881)
- `meta$e 要素~用の `color-scheme$v 値の定義を `HTML$r 仕様に移動した。 ◎ Moved the definition of the color-scheme meta value to the [HTML] specification.
- `強制d色~mode$に影響される~propの~listに `color-scheme$p を追加した。 ( `3885$issue ) ◎ Added color-scheme to list of properties affected by forced colors mode. (Issue 3885)
- すでに~system色に設定された~propは、 色の強制-法から免除するようにした。 ( `4178$issue ) ◎ Exempted properties already set as system colors from color forcing. (Issue 4178)
- 色の強制-法は、 `算出d値$ではなく`使用~値$に対し演算するよう切替えた。 ( `4915$issue ) ◎ Switched color forcing to a used value rather than computed value operation. (Issue 4915)
- `2019 年 5 月 23日 作業草案@~TR/2019/WD-css-color-adjust-1-20190523/$ からの変更点: ◎ Changes since the 23 May 2019 Working Draft:
- 強制d背景~色は、 【~UA~stylesheetにて】 `revert$v するのでなく,~alpha以外の色~channelに限り強制するようにした(作者が与える透明度を保全するよう)。 ( `4175$issue ) ◎ Forced background colors don’t revert, they force all color channels other than alpha (to preserve author’s transparency). Issue 4175.
- 他の~prop 【すなわち,`強制d色~modeに影響される@#forced-colors-properties$ `background-color$p 以外の~prop】 は — ~cascadeの中に `revert !important^css 規則を注入するのではなく — `revert$v を指定するよう書直すことにより,作者~levelの規則を `revert^v するようにした。 ( `4020$issue ) ◎ Other properties revert by rewriting author-level rules to specify revert, not by injecting revert !important rules into the cascade. Issue 4020.
- `iframe$e に対しては、 それを埋込んだ文書と互いの `color-adjust$p が合致しない場合には,不透明な背景に強制することにした。 ( `4472$issue ) ◎ Force opaque background if color-adjust mismatches between iframe and embedded document. Issue 4472.
- ~SVG~textに対しては、 色を強制しないようにした。 ◎ Don’t force colors on SVG text.
- `color-scheme$p 用の値 `auto^v を `normal^v に改称した。 ( `3849$issue ) ◎ Rename color-scheme: auto to color-scheme: normal. Issue 3849.
- 諸々の明確化。 ◎ Miscellaneous clarifications.