Skip to content

Commit 1f808b7

Browse files
committed
Minimize :host styles
1 parent 3b51652 commit 1f808b7

File tree

13 files changed

+77
-57
lines changed

13 files changed

+77
-57
lines changed

src/includes/form-button-widget/base.styles.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@ import {css} from 'lit';
33
export default [
44
css`
55
:host {
6-
color: var(--vscode-foreground, #cccccc);
76
display: inline-block;
8-
font-family: var(--vscode-font-family, sans-serif);
9-
font-size: var(--vscode-font-size, 13px);
10-
font-weight: var(--vscode-font-weight, normal);
11-
line-height: 18px;
127
}
138
149
:host(:focus) {
@@ -20,9 +15,13 @@ export default [
2015
}
2116
2217
.wrapper {
18+
color: var(--vscode-foreground, #cccccc);
2319
cursor: pointer;
2420
display: block;
21+
font-family: var(--vscode-font-family, sans-serif);
2522
font-size: var(--vscode-font-size, 13px);
23+
font-weight: var(--vscode-font-weight, normal);
24+
line-height: 18px;
2625
margin-bottom: 4px;
2726
margin-top: 4px;
2827
min-height: 18px;
@@ -35,15 +34,15 @@ export default [
3534
}
3635
3736
input {
38-
position: absolute;
37+
clip: rect(1px, 1px, 1px, 1px);
3938
height: 1px;
4039
left: 9px;
4140
margin: 0;
42-
top: 17px;
43-
width: 1px;
4441
overflow: hidden;
45-
clip: rect(1px, 1px, 1px, 1px);
42+
position: absolute;
43+
top: 17px;
4644
white-space: nowrap;
45+
width: 1px;
4746
}
4847
4948
.icon {

src/vscode-context-menu-item/vscode-context-menu-item.styles.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ const styles: CSSResultGroup = [
66
css`
77
:host {
88
display: block;
9-
font-family: var(--vscode-font-family, sans-serif);
10-
font-size: var(--vscode-font-size, 13px);
11-
font-weight: var(--vscode-font-weight, normal);
12-
line-height: 1.4em;
139
outline: none;
1410
position: relative;
1511
}
@@ -18,6 +14,10 @@ const styles: CSSResultGroup = [
1814
background-color: var(--vscode-menu-background, #1f1f1f);
1915
color: var(--vscode-menu-foreground, #cccccc);
2016
display: flex;
17+
font-family: var(--vscode-font-family, sans-serif);
18+
font-size: var(--vscode-font-size, 13px);
19+
font-weight: var(--vscode-font-weight, normal);
20+
line-height: 1.4em;
2121
user-select: none;
2222
white-space: nowrap;
2323
}

src/vscode-context-menu/vscode-context-menu.styles.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ const styles: CSSResultGroup = [
66
css`
77
:host {
88
display: block;
9-
font-family: var(--vscode-font-family, sans-serif);
10-
font-size: var(--vscode-font-size, 13px);
11-
font-weight: var(--vscode-font-weight, normal);
12-
line-height: 1.4em;
139
position: relative;
1410
}
1511
@@ -21,6 +17,10 @@ const styles: CSSResultGroup = [
2117
border-width: 1px;
2218
box-shadow: 0 2px 8px var(--vscode-widget-shadow, rgba(0, 0, 0, 0.36));
2319
color: var(--vscode-menu-foreground, #cccccc);
20+
font-family: var(--vscode-font-family, sans-serif);
21+
font-size: var(--vscode-font-size, 13px);
22+
font-weight: var(--vscode-font-weight, normal);
23+
line-height: 1.4em;
2424
padding: 4px 0;
2525
white-space: nowrap;
2626
}

src/vscode-divider/vscode-divider.styles.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ const styles: CSSResultGroup = [
55
defaultStyles,
66
css`
77
:host {
8-
background-color: var(--vscode-foreground, #cccccc);
98
display: block;
10-
height: 1px;
119
margin-bottom: 10px;
1210
margin-top: 10px;
11+
}
12+
13+
div {
14+
background-color: var(--vscode-foreground, #cccccc);
15+
height: 1px;
1316
opacity: 0.4;
1417
}
1518
`,

src/vscode-divider/vscode-divider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class VscodeDivider extends VscElement {
1616
override role: 'separator' | 'presentation' = 'separator';
1717

1818
override render(): TemplateResult {
19-
return html``;
19+
return html`<div></div>`;
2020
}
2121
}
2222

src/vscode-progress-ring/vscode-progress-ring.styles.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const styles: CSSResultGroup = [
55
defaultStyles,
66
css`
77
:host {
8-
align-items: center;
98
display: block;
109
height: 28px;
1110
margin: 0;

src/vscode-tab-header/vscode-tab-header.styles.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,30 @@ const styles: CSSResultGroup = [
55
defaultStyles,
66
css`
77
:host {
8-
border-bottom: 1px solid transparent;
98
cursor: pointer;
109
display: block;
11-
margin-bottom: -1px;
10+
user-select: none;
11+
}
12+
13+
.wrapper {
14+
align-items: center;
15+
border-bottom: 1px solid transparent;
16+
color: var(--vscode-foreground);
17+
display: flex;
18+
min-height: 20px;
1219
overflow: hidden;
1320
padding: 7px 8px;
21+
position: relative;
1422
text-overflow: ellipsis;
15-
user-select: none;
1623
white-space: nowrap;
1724
}
1825
19-
:host([active]) {
26+
:host([active]) .wrapper {
2027
border-bottom-color: var(--vscode-panelTitle-activeForeground);
2128
color: var(--vscode-panelTitle-activeForeground);
2229
}
2330
24-
:host([panel]) {
31+
:host([panel]) .wrapper {
2532
border-bottom: 0;
2633
margin-bottom: 0;
2734
padding: 0;

src/vscode-tabs/vscode-tabs.styles.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const styles: CSSResultGroup = [
3333
3434
.tablist {
3535
display: flex;
36+
margin-bottom: -1px;
3637
}
3738
3839
slot[name='addons'] {

src/vscode-textarea/vscode-textarea.styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const styles: CSSResultGroup = [
66
css`
77
:host {
88
display: inline-block;
9-
height: 40px;
9+
height: auto;
1010
position: relative;
1111
width: 320px;
1212
}

src/vscode-textfield/vscode-textfield.styles.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ const styles: CSSResultGroup = [
88
defaultStyles,
99
css`
1010
:host {
11+
display: inline-block;
12+
width: 320px;
13+
}
14+
15+
.root {
1116
align-items: center;
1217
background-color: var(--vscode-settings-textInputBackground, #313131);
1318
border-color: var(
@@ -19,10 +24,10 @@ const styles: CSSResultGroup = [
1924
border-width: 1px;
2025
box-sizing: border-box;
2126
color: var(--vscode-settings-textInputForeground, #cccccc);
22-
display: inline-flex;
27+
display: flex;
2328
max-width: 100%;
2429
position: relative;
25-
width: 320px;
30+
width: 100%;
2631
}
2732
2833
:host([focused]) {

0 commit comments

Comments
 (0)