11// Import Third-party Dependencies
2- import { LitElement , html } from "lit" ;
2+ import { LitElement , html , css } from "lit" ;
33import { when } from "lit/directives/when.js" ;
44
55// Import Internal Dependencies
66import { currentLang } from "../../common/utils" ;
7+ import "../icon/icon.js" ;
78
89class Expandable extends LitElement {
10+ static styles = css `
11+ span.expandable {
12+ display: flex;
13+ align-items: center !important;
14+ justify-content: center !important;
15+ height: 35px;
16+ font-size: 13px;
17+ font-family: mononoki;
18+ background: none;
19+ color: #00B0FF;
20+ text-shadow: 1px 1px 1px rgb(20 20 20 / 50%);
21+ transition: all 0.2s linear;
22+ margin-top: 5px;
23+ }
24+
25+ span.expandable[data-value="opened"] {
26+ color: #F44336 !important;
27+ }
28+
29+ span.expandable:hover {
30+ cursor: pointer;
31+ }
32+
33+ span.expandable nsecure-icon {
34+ margin-right: 4px;
35+ margin-top: 1px;
36+ }
37+ ` ;
938 static properties = {
1039 onToggle : { type : Function } ,
1140 isClosed : { type : Boolean }
@@ -17,20 +46,15 @@ class Expandable extends LitElement {
1746 this . onToggle = ( ) => void 0 ;
1847 }
1948
20- // FIXME: must opt out from the shadow DOM for now because of to be able to apply CSS from fontello
21- createRenderRoot ( ) {
22- return this ;
23- }
24-
2549 render ( ) {
2650 const lang = currentLang ( ) ;
2751
2852 return html `
2953 < span data-value =${ this . isClosed ? "opened" : "closed" } @click =${ this . #handleClick} class="expandable">
3054 ${ when ( this . isClosed ,
31- ( ) => html `< i class =" icon- minus-squared-alt "> </ i >
55+ ( ) => html `< nsecure-icon name =" minus "> </ nsecure-icon >
3256 < p > ${ window . i18n [ lang ] . home . showLess } </ p > ` ,
33- ( ) => html `< i class =" icon- plus-squared-alt "> </ i >
57+ ( ) => html `< nsecure-icon name =" plus "> </ nsecure-icon >
3458 < p > ${ window . i18n [ lang ] . home . showMore } </ p > `
3559 ) }
3660 </ span >
0 commit comments