Skip to content

Commit b5a8f01

Browse files
author
owner
committed
feat(select): add css vars for divider spacing
1 parent 3670e0f commit b5a8f01

File tree

6 files changed

+15
-1
lines changed

6 files changed

+15
-1
lines changed

src/dev-app/select/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ ng_project(
1616
"//src/material/button",
1717
"//src/material/card",
1818
"//src/material/checkbox",
19+
"//src/material/divider",
1920
"//src/material/form-field",
2021
"//src/material/icon",
2122
"//src/material/input",

src/dev-app/select/select-demo.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,14 @@
174174
</mat-card>
175175

176176
<mat-card>
177-
<mat-card-subtitle>Appearance comparison</mat-card-subtitle>
177+
<mat-card-subtitle>Appearance comparison (with dividers)</mat-card-subtitle>
178178
<mat-card-content>
179179
<p>
180180
<mat-form-field appearance="fill">
181181
<mat-label>Fill</mat-label>
182182
<mat-select [(value)]="currentAppearanceValue">
183183
<mat-option>None</mat-option>
184+
<mat-divider />
184185
@for (creature of digimon; track creature) {
185186
<mat-option [value]="creature.value">{{ creature.viewValue }}</mat-option>
186187
}
@@ -193,6 +194,7 @@
193194
<mat-label>Outline</mat-label>
194195
<mat-select [(value)]="currentAppearanceValue">
195196
<mat-option>None</mat-option>
197+
<mat-divider />
196198
@for (creature of digimon; track creature) {
197199
<mat-option [value]="creature.value">{{ creature.viewValue }}</mat-option>
198200
}

src/dev-app/select/select-demo.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {FormControl, FormsModule, ReactiveFormsModule, Validators} from '@angula
1212
import {MatButtonModule} from '@angular/material/button';
1313
import {MatCardModule} from '@angular/material/card';
1414
import {MatCheckboxModule} from '@angular/material/checkbox';
15+
import {MatDividerModule} from '@angular/material/divider';
1516
import {ErrorStateMatcher, ThemePalette} from '@angular/material/core';
1617
import {FloatLabelType} from '@angular/material/form-field';
1718
import {MatIconModule} from '@angular/material/icon';
@@ -40,6 +41,7 @@ type DisableDrinkOption = 'none' | 'first-middle-last' | 'all';
4041
MatButtonModule,
4142
MatCardModule,
4243
MatCheckboxModule,
44+
MatDividerModule,
4345
MatIconModule,
4446
MatInputModule,
4547
MatSelectModule,

src/material/select/_m2-select.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
@return (
1212
base: (
1313
select-container-elevation-shadow: elevation.get-box-shadow(8),
14+
select-divider-bottom-spacing: 0,
15+
select-divider-top-spacing: 0
1416
),
1517
color: private-get-color-palette-color-tokens($theme, primary),
1618
typography: (

src/material/select/_m3-select.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ $prefix: (mat, select);
1919
@return (
2020
base: (
2121
select-container-elevation-shadow: elevation.get-box-shadow(2),
22+
select-divider-bottom-spacing: 8px,
23+
select-divider-top-spacing: 8px
2224
),
2325
color: (
2426
select-panel-background-color: map.get($system, surface-container),

src/material/select/select.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ $fallbacks: m3-select.get-tokens();
5252
}
5353
div.mat-mdc-select-panel {
5454
box-shadow: token-utils.slot(select-container-elevation-shadow, $fallbacks);
55+
56+
.mat-divider {
57+
margin-top: token-utils.slot(select-divider-top-spacing, $fallbacks);
58+
margin-bottom: token-utils.slot(select-divider-bottom-spacing, $fallbacks);
59+
}
5560
}
5661

5762
.mat-mdc-select-disabled {

0 commit comments

Comments
 (0)