File tree Expand file tree Collapse file tree 8 files changed +107
-4
lines changed Expand file tree Collapse file tree 8 files changed +107
-4
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ // import 'jasmine'; (google3-only)
8
+
9
+ import { createTokenTests } from '../../testing/tokens.js' ;
10
+
11
+ import { MdElevatedCard } from './elevated-card.js' ;
12
+
13
+ describe ( '<md-elevated-card>' , ( ) => {
14
+ describe ( '.styles' , ( ) => {
15
+ createTokenTests ( MdElevatedCard . styles ) ;
16
+ } ) ;
17
+ } ) ;
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ // import 'jasmine'; (google3-only)
8
+
9
+ import { createTokenTests } from '../../testing/tokens.js' ;
10
+
11
+ import { MdFilledCard } from './filled-card.js' ;
12
+
13
+ describe ( '<md-filled-card>' , ( ) => {
14
+ describe ( '.styles' , ( ) => {
15
+ createTokenTests ( MdFilledCard . styles ) ;
16
+ } ) ;
17
+ } ) ;
Original file line number Diff line number Diff line change 27
27
@mixin styles () {
28
28
$tokens : tokens .md-comp-elevated-card-values ();
29
29
30
- // TODO(b/261201808): add styles
30
+ :host {
31
+ @each $token , $value in $tokens {
32
+ --_ #{$token } : var (--md-elevated-card - #{$token } , #{$value } );
33
+ }
34
+ }
31
35
}
Original file line number Diff line number Diff line change 27
27
@mixin styles () {
28
28
$tokens : tokens .md-comp-filled-card-values ();
29
29
30
- // TODO(b/261201808): add styles
30
+ :host {
31
+ @each $token , $value in $tokens {
32
+ --_ #{$token } : var (--md-filled-card - #{$token } , #{$value } );
33
+ }
34
+ }
31
35
}
Original file line number Diff line number Diff line change 27
27
@mixin styles () {
28
28
$tokens : tokens .md-comp-outlined-card-values ();
29
29
30
- // TODO(b/261201808): add styles
30
+ :host {
31
+ @each $token , $value in $tokens {
32
+ --_ #{$token } : var (--md-outlined-card - #{$token } , #{$value } );
33
+ }
34
+ }
35
+
36
+ .container {
37
+ outline : var (--_outline-width ) solid var (--_outline-color );
38
+ }
31
39
}
Original file line number Diff line number Diff line change 3
3
// SPDX-License-Identifier: Apache-2.0
4
4
//
5
5
6
+ // go/keep-sorted start
7
+ @use ' ../../../elevation/elevation' ;
8
+ // go/keep-sorted end
9
+
6
10
@mixin styles () {
7
11
:host {
12
+ border-radius : var (--_container-shape );
8
13
display : flex ;
14
+ padding : 16px ;
15
+ position : relative ;
16
+ }
17
+
18
+ // Separate element will be needed for disabled opacities (b/307361748)
19
+ .container {
20
+ background : var (--_container-color );
21
+ border-radius : inherit ;
22
+ inset : 0 ;
23
+ position : absolute ;
24
+ }
25
+
26
+ md-elevation {
27
+ border-radius : inherit ;
28
+
29
+ @include elevation .theme (
30
+ (
31
+ ' level' : var (--_container-elevation ),
32
+ ' shadow-color' : var (--_container-shadow-color ),
33
+ )
34
+ );
35
+ }
36
+
37
+ slot {
38
+ z-index : 0 ; // Place content above background elements
9
39
}
10
40
}
Original file line number Diff line number Diff line change 4
4
* SPDX-License-Identifier: Apache-2.0
5
5
*/
6
6
7
+ import '../../../elevation/elevation.js' ;
8
+
7
9
import { html , LitElement } from 'lit' ;
8
10
9
11
/**
10
12
* A card component.
11
13
*/
12
14
export class Card extends LitElement {
13
15
protected override render ( ) {
14
- return html `< slot > </ slot > ` ;
16
+ return html `
17
+ < md-elevation part ="elevation "> </ md-elevation >
18
+ < div class ="container "> </ div >
19
+ < slot > </ slot >
20
+ ` ;
15
21
}
16
22
}
Original file line number Diff line number Diff line change
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ // import 'jasmine'; (google3-only)
8
+
9
+ import { createTokenTests } from '../../testing/tokens.js' ;
10
+
11
+ import { MdOutlinedCard } from './outlined-card.js' ;
12
+
13
+ describe ( '<md-outlined-card>' , ( ) => {
14
+ describe ( '.styles' , ( ) => {
15
+ createTokenTests ( MdOutlinedCard . styles ) ;
16
+ } ) ;
17
+ } ) ;
You can’t perform that action at this time.
0 commit comments