File tree Expand file tree Collapse file tree 5 files changed +39
-9
lines changed Expand file tree Collapse file tree 5 files changed +39
-9
lines changed Original file line number Diff line number Diff line change 4
4
"ng_module" ,
5
5
"ng_test_library" ,
6
6
"ng_web_test_suite" ,
7
+ "sass_binary" ,
7
8
)
8
9
9
10
package (default_visibility = ["//visibility:public" ])
@@ -14,7 +15,7 @@ ng_module(
14
15
["**/*.ts" ],
15
16
exclude = ["**/*.spec.ts" ],
16
17
),
17
- assets = glob (["**/*.html" ]),
18
+ assets = [ ":dialog-container.css" ] + glob (["**/*.html" ]),
18
19
deps = [
19
20
"//src:dev_mode_types" ,
20
21
"//src/cdk/a11y" ,
@@ -61,3 +62,8 @@ filegroup(
61
62
name = "source-files" ,
62
63
srcs = glob (["**/*.ts" ]),
63
64
)
65
+
66
+ sass_binary (
67
+ name = "dialog_container_scss" ,
68
+ src = "dialog-container.scss" ,
69
+ )
Original file line number Diff line number Diff line change
1
+ .cdk-dialog-container {
2
+ // The container is a custom node so it'll be `display: inline` by default.
3
+ display : block ;
4
+
5
+ // The dialog container should completely fill its parent overlay element.
6
+ width : 100% ;
7
+ height : 100% ;
8
+
9
+ // Since the dialog won't stretch to fit the parent, if the height
10
+ // isn't set, we have to inherit the min and max values explicitly.
11
+ min-height : inherit ;
12
+ max-height : inherit ;
13
+ }
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ export function throwDialogContentAlreadyAttachedError() {
49
49
@Component ( {
50
50
selector : 'cdk-dialog-container' ,
51
51
templateUrl : './dialog-container.html' ,
52
+ styleUrls : [ 'dialog-container.css' ] ,
52
53
encapsulation : ViewEncapsulation . None ,
53
54
// Using OnPush for dialogs caused some G3 sync issues. Disabled until we can track them down.
54
55
// tslint:disable-next-line:validate-decorators
Original file line number Diff line number Diff line change 1
- .demo-cdk-dialog {
2
- background : white ;
3
- padding : 20px ;
4
- border-radius : 8px ;
5
- }
6
-
7
1
.demo-container {
8
2
button , label {
9
3
margin-right : 8px ;
Original file line number Diff line number Diff line change @@ -75,8 +75,24 @@ export class DialogDemo {
75
75
<button (click)="temporarilyHide()">Hide for 2 seconds</button>
76
76
</div>
77
77
` ,
78
- encapsulation : ViewEncapsulation . None ,
79
- styles : [ `.hidden-dialog { opacity: 0; }` ] ,
78
+ styles : [
79
+ `
80
+ :host {
81
+ background: white;
82
+ padding: 20px;
83
+ border-radius: 8px;
84
+ display: block;
85
+ width: 100%;
86
+ height: 100%;
87
+ min-width: inherit;
88
+ min-height: inherit;
89
+ }
90
+
91
+ :host-context(.hidden-dialog) {
92
+ opacity: 0;
93
+ }
94
+ ` ,
95
+ ] ,
80
96
standalone : true ,
81
97
} )
82
98
export class JazzDialog {
You can’t perform that action at this time.
0 commit comments