Web Components データ グリッドのテーマ

    Web Components テーマ エンジンを使用すると、Ignite UI for Web Components Grid をブランド アイデンティティに合わせて簡単にカスタマイズできます。 定義済みのテーマとパレットに加えて、一連の CSS カスタム プロパティを使用して、データ グリッドのルック アンド フィールをさらにカスタマイズできます。

    利用可能なテーマ プロパティ

    プロパティ名 説明
    --grid-elevation 0 ~ 24 の数 グリッドに使用されるのエレベーション レベル。
    --drag-elevation 0 ~ 24 の数 移動可能な要素 (列ヘッダーなど) に使用される のエレベーション レベル。
    --grouparea-color グリッド グループ領域テキストの色。
    --grouparea-background グリッド グループ領域テキストの色。
    --drop-area-text-color ドロップ領域テキストの色。
    --drop-area-icon-color ドロップ領域アイコンの色。
    --drop-area-background ドロップ領域の背景色。
    --drop-area-on-drop-background ドロップ色のドロップ領域の背景。
    --header-background グリッド ヘッダーの背景色。
    --header-text-color グリッド ヘッダーのテキストの色。
    --header-selected-background 選択時のグリッド ヘッダーの背景色 (列の選択など)。
    --header-selected-text-color 選択時のグリッド ヘッダーのテキスト色 (列の選択など)。
    --sortable-header-icon-hover-color 列のソートが可能な場合のグリッド ヘッダーのホバーのアイコンの色。
    --sorted-header-icon-color ソートされたテーブル ヘッダー アイコンの色。
    --header-border-width 境界線の幅 ヘッダー境界線に使用される境界線の幅。
    --header-border-style 境界線スタイル ヘッダー境界線に使用される境界線のスタイル。点線、破線、実線になります。
    --header-border-color ヘッダー境界線に使用される色。
    --ghost-header-background ドラッグされたヘッダーの背景色。
    --ghost-header-text-color ドラッグされたヘッダーテキストの色。
    --ghost-header-icon-color ドラッグされたヘッダー アイコンの色。
    --filtering-background-and 高度なフィルタリングの "AND" 条件の背景色。
    --filtering-background-or 高度なフィルタリングの "AND" 条件のフォーカス/選択の背景色。
    --filtering-background-and--focus 高度なフィルタリングの "OR" 条件の背景色。
    --filtering-background-or--focus 高度なフィルタリングの "OR" 条件のフォーカス/選択の背景色。
    --grid-border-color グリッドを囲む境界線の色。
    --content-background グリッド本体の背景色。
    --content-text-color グリッド本体のテキストの色。
    --row-odd-background 奇数行の背景色。
    --row-even-background 偶数行の背景色。
    --row-odd-text-color 奇数行テキストの色。
    --row-even-text-color 偶数行テキストの色。
    --row-selected-background 選択された行の背景色。
    --tree-selected-filtered-row-text-color 選択された/フィルターされた行のテキストの色。
    --row-selected-text-color 選択された行のテキストの色。
    --cell-selected-within-background 選択した行/列内の選択したセルの背景。
    --cell-selected-within-text-color 選択した行/列内の選択したセルの色。
    --row-selected-hover-background 選択された行のホバーの背景色。
    --row-selected-hover-text-color 選択された行のホバー状態のテキスト
    --row-hover-background ホバー行の背景色。
    --row-hover-text-color ホバー行のテキストの色。
    --row-border-color グリッド本体の行間の境界線色。
    --pinned-border-width 境界線の幅 ピン固定された行/列の境界線の幅。
    --pinned-border-style 境界線スタイル ピン固定された行/列の境界線のスタイル。点線、破線、実線になります。
    --pinned-border-color ピン固定された行/列の境界線色。
    --cell-active-border-color アクティブな (フォーカスされれいる) セルの境界線色。
    --cell-selected-background 選択されたセルの背景色。
    --tree-selected-filtered-cell-text-color 選択された/フィルターされたセルのテキストの色。
    --cell-selected-text-color 選択されたセルのテキストの色。
    --cell-editing-background 編集モードのセルの背景色。
    --edit-mode-color 編集モードのテキストの色。
    --edited-row-indicator 編集された行のインジケーターの色。
    --cell-new-color 編集されていない新しいセルのテキスト色。グリッドに新しい行を追加するときに使用されます。
    --cell-edited-value-color セル編集値の色。
    --cell-disabled-color 無効なセルのテキストの色。
    --resize-line-color グリッド ヘッダーのサイズ変更線の色。
    --drop-indicator-color ドロップ インジケーターの色。
    --group-label-column-name-text グリッド グループ行名前のテキストの色。
    --group-label-icon グリッド グループ行アイコンの色。
    --group-label-text グリッド グループ行テキストの色。
    --expand-all-icon-color グリッド ヘッダーすべてのグループ行の展開のアイコンの色。
    --expand-all-icon-hover-color グリッド ヘッダーすべてのグループ行の展開のアイコン ホバーの色。
    --expand-icon-color グリッド行の展開アイコンの色。
    --expand-icon-hover-color グリッド行の展開アイコン ホバーの色。
    --active-expand-icon-color ドロップ色のドロップ領域の背景。
    --active-expand-icon-hover-color ドロップ色のドロップ領域の背景。
    --group-count-background グリッド グループの行数バッジの背景色。
    --group-count-text-color グリッド グループの行数バッジのテキストの色。
    --group-row-background グリッド グループ行の背景色。
    --group-row-selected-background ドロップ色のドロップ領域の背景。
    --filtering-header-background フィルター済み列ヘッダーの背景色。
    --filtering-header-text-color フィルター済み列ヘッダーテキストの色。
    --filtering-row-background フィルタリング行の背景色。
    --filtering-row-text-color フィルタリング行の text-color の色。
    --tree-filtered-text-color フォーカスされているグループ化行の背景色。
    --body-summaries-background 本体に配置される集計グループの背景色。
    --body-summaries-text-color 本体に配置される集計グループのテキストの色。
    --root-summaries-background フッターに配置される集計グループの背景色。
    --root-summaries-text-color フッターに配置される集計グループのテキストの色。
    --row-highlight グリッド行の強調表示の色。
    --row-ghost-background ドラッグされている行の背景色。
    --row-drag-color ドラッグ ハンドルの色。
    --drop-area-border-radius 0 ~ 1 の数 ドロップ領域に使用される境界半径。0 ~ 1 の任意の小数、ピクセル、またはパーセントを指定できます。

    使用方法

    前述のように、テーブルの CSS 変数を使用すると、グリッドのスタイルを設定できます。次のヘッダーの背景やテキストの色などを変更することで、ダーク テーマを使用するようにグリッドを変更したいとします。これは、オプションで dark-theme.css というファイルで行うことができます。

    import "./dark-theme.css";

    .ig-data-grid {
      /* shared variables used in custom properties */
      --cell-text-color:#58258b;
      --cell-background:#191919;
      --cell-selected-background: #58258b;
      --cell-selected-within-text-color: #191919;
      --cell-selected-within-background: #58258b;
    
      --row-selected-background:var(--cell-selected-background);
      --row-hover-background:var(--cell-selected-background);
      --row-hover-text-color:var(--cell-background);
    
      --header-background: #58258b;
      --header-text-color: #191919;
      --header-separator-background: #58258b;
      --header-separator-width: 5px;
    
      --section-header-background: #191919;
      --section-header-text-color: #58258b;
      --section-header-selected-background: #58258b;
      --section-header-selected-text-color: #191919;
    
      --row-separator-background: #191919;
      --row-separator-last-sticky-row-background: #191919;
      --row-separator-pinned-row-background: #58258b;
      --row-separator-sticky-row-background: #58258b;
    
      --column-resizing-separator-background: #58258b;
      --column-moving-separator-background: #58258b;
    
    
      --filtering-header-background: #272727;
      --filtering-header-text-color: #ffffff;
      --filtering-row-background: #272727;
      --filtering-row-text-color: #ffffff;
      --tree-filtered-text-color: #ffffff;
    
      --summary-root-background: #7446b9;
      --summary-root-label-text-color: #191919;
      --summary-root-value-text-color: #191919;
    }
    
    .ig-grid-column-options {
      --background-color: black;
      --text-color: #7446b9;
      --summary-list-text-color: #7446b9;
      --summary-list-background: #191919;
    }
    
    .ig-data-grid-toolbar {
      --background-color: #191919;
      --text-color: #58258b;
      --dialog-background-color: #191919;
    }
    
    .ig-column-chooser {
      --background-color: #191919;
      --title-color: green;
      --select-all-caption-text-color: #58258b;
      --search-icon-color: #58258b;
      --search-text-color: #58258b;
      --search-background-color: #191919;
      --search-border-color: #58258b;
      --search-text-style: 12px 'Courier';
    }
    
    .ig-column-pinning {
      --background-color: white;
      --text-color: #7446b9;
      --select-all-caption-text-color: #58258b;
      --search-icon-color: #58258b;
      --search-text-color: #58258b;
      --search-background-color: #191919;
      --search-border-color: #58258b;
      --search-text-style: 12px 'Courier';
    }