Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit 776c186

Browse files
Elliott Marquezcopybara-github
authored andcommitted
feat(dialog): add custom property for z-index
PiperOrigin-RevId: 349484781
1 parent f6e1678 commit 776c186

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//
2+
// Copyright 2020 Google Inc.
3+
//
4+
// Permission is hereby granted, free of charge, to any person obtaining a copy
5+
// of this software and associated documentation files (the "Software"), to deal
6+
// in the Software without restriction, including without limitation the rights
7+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
// copies of the Software, and to permit persons to whom the Software is
9+
// furnished to do so, subject to the following conditions:
10+
//
11+
// The above copyright notice and this permission notice shall be included in
12+
// all copies or substantial portions of the Software.
13+
//
14+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20+
// THE SOFTWARE.
21+
//
22+
23+
$z-index: --mdc-dialog-z-index;

packages/mdc-dialog/_mixins.scss

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@
3030
@use '@material/feature-targeting/feature-targeting';
3131
@use '@material/rtl/mixins' as rtl-mixins;
3232
@use '@material/shape/mixins' as shape-mixins;
33+
@use '@material/theme/custom-properties';
3334
@use '@material/theme/theme';
3435
@use '@material/theme/theme-color';
3536
@use '@material/touch-target/variables' as touch-target-variables;
3637
@use '@material/typography/typography';
38+
@use './dialog-custom-properties';
3739
@use './variables';
3840

3941
@mixin core-styles($query: feature-targeting.all()) {
@@ -78,7 +80,11 @@
7880
@include feature-targeting.targets($feat-structure) {
7981
// Use `display: none` instead of `visibility: hidden` to avoid recalculating layout when the dialog is closed.
8082
display: none;
81-
z-index: variables.$z-index;
83+
$z-index: custom-properties.create(
84+
dialog-custom-properties.$z-index,
85+
variables.$z-index
86+
);
87+
@include theme.property(z-index, $z-index);
8288
}
8389
}
8490

0 commit comments

Comments
 (0)