ここでは、サポートされている USS プロパティーとその値について説明します。
USS データ型は、USS プロパティーが受け入れる値とキーワードを定義します。
#hexadecimal code, rgb(), or rgba(). Color keywords such as blue or transparent are not supported.UIElement のスタイルプロパティーは、W3C CSS ドキュメントと同じ文法構文を使用します。
auto、baseline
< と >) に表記します。例えば <length>、<color>
<' and '>). For example, <‘width’>.プロパティー値に複数のコンポーネントがある場合は以下の通りです。
|) separates two or more alternatives: exactly one must occur.||) separates two or more options: one or more must occur, in any order.&&) は、2 つ以上のコンポーネントを区切ります。これらのコンポーネントは任意の順序で発生します。[ ]) はグループ化を意味します。すべての型、キーワード、または山括弧 <> で囲まれたグループの後にモディファイアが記述される場合があります。
*) は、前に記述された型、単語、またはグループが 0 回以上発生することを示します。+) は、前に記述された型、単語、またはグループが 1 回以上発生することを示します。?) は、前に記述された型、単語、またはグループが必須でないことを示します。{A,B}) の数字は、前に記述された型、単語、またはグループが少なくとも A 回、最大で B 回発生することを示します。継承プロパティーに値が指定されていない場合、 要素は親要素から値を取得します。例えば、継承プロパティーを使用して、すべての要素のフォントを設定します。
:root {
-unity-font: resource("Font/consola.ttf");
}
その結果、以下のプロパティーが継承されます。
width と height は要素のサイズを指定します。width が指定されない場合、幅は要素の内容の幅にもとづいて決定されます。height が指定されない場合、高さは要素のコンテンツの高さに基づきます。
margin 簡易表記オプションは以下のように適用されます。
margin-top and margin-bottom. The second is applied to margin-left and margin-right.margin-top. The second is applied to margin-left and margin-right. The third is applied to margin-bottom.margin-top, margin-right, margin-bottom, margin-left
border-width 簡易表記オプションは以下のように適用されます。
border-top-width and border-bottom-width. The second is applied to border-left-width and border-right-width.border-top-width. The second is applied to border-left-width and border-right-width. The third is applied to border-bottom-width.border-top-width, border-right-width, border-bottom-width, border-left-width
padding 省略オプションは以下のように適用されます。
padding-top and padding-bottom. The second is applied to padding-left and padding-right.padding-top. The second is applied to padding-left and padding-right. The third is applied to padding-bottom.padding-top, padding-right, padding-bottom, padding-left
このセクションでは、視覚要素を配置するためのプロパティーを列挙します。UIElement には レイアウトエンジン が含まれ、レイアウトやスタイリングのプロパティーに基づいて視覚要素を配置します。レイアウトエンジンは、HTML/CSS レイアウトシステムの 1 つである Flexbox のサブセットを実装しています。
デフォルトでは、すべてのアイテムは垂直にコンテナに配置されます。
このプロパティーは、デフォルトで relative に設定されています。これは、親に基づいて要素を配置します。このプロパティーが absolute に設定されている場合、要素は親のレイアウトを離れ、親の領域に基づいて値が指定されます。
親のエッジまたは、要素の元の位置からの距離。
描画プロパティーは、視覚要素の背景、境界線、外観を設定します。
背景画像を割り当てるとき、それは簡略化された 9 スライス仕様に基づいて描画されます。
border-radius 簡易表記オプションは以下のように適用されます。
border-top-left-radius and border-bottom-right-radius. The second is applied to border-bottom-left-radius and border-top-right-radius
border-top-left-radius. The second is applied to border-bottom-left-radius and border-top-right-radius. The third is applied to border-bottom-right-radius.border-top-left-radius, border-top-right-radius, border-bottom-right-radius, border-bottom-left-radius
The display default value is flex. Setting display to none removes the element.
テキストプロパティーは、フォント、フォントサイズ、フォントリソースの Unity 特有のプロパティー、フォントスタイル、整列、ワードラップ、クリッピングを設定します。
cursor のデフォルトテクスチャタイプを使用して、カーソルのカスタムテクスチャをインポートします。
cursor: [ [ <resource> | <url> ][ <integer> <integer>]? , ][ arrow | text | resize-vertical | resize-horizontal | link | slide-arrow | resize-up-right | resize-up-left | move-arrow | rotate-arrow | scale-arrow | arrow-plus | arrow-minus | pan | orbit | zoom | fps | split-resize-up-down | split-resize-left-right ]