Skip to content

Commit a5379f3

Browse files
authored
refactor(ux): css variables for font-sizes aws#5042
Problem Update font-sizes in Login Page for AWS Toolkits and Amazon Q Solution - Use CSS Variables - Initially used `rem` though now using `var(--vscode-font-size)` for base font size. This way the extension's base font will be as set by user for their VSCode - fixed colors for dark and light theme
1 parent afe1a39 commit a5379f3

File tree

3 files changed

+29
-18
lines changed

3 files changed

+29
-18
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
:root {
2+
/* Font-sizes */
3+
--font-size-sm: calc(0.75 * var(--font-size-base));
4+
--font-size-base: var(--vscode-font-size);
5+
--font-size-md: calc(1.25 * var(--font-size-base));
6+
--font-size-lg: calc(1.5 * var(--font-size-base));
7+
--font-size-xl: calc(1.75 * var(--font-size-base));
8+
}

packages/core/src/login/webview/vue/login.vue

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,8 @@ export default defineComponent({
574574
</script>
575575

576576
<style>
577+
@import './base.css';
578+
577579
.selectable-item {
578580
margin-bottom: 10px;
579581
margin-top: 10px;
@@ -590,7 +592,7 @@ export default defineComponent({
590592
color: #c6c6c6;
591593
margin-bottom: 5px;
592594
margin-top: 5px;
593-
font-size: 10px;
595+
font-size: var(--font-size-sm);
594596
font-weight: 500;
595597
}
596598
.vscode-light .hint {
@@ -611,31 +613,32 @@ export default defineComponent({
611613
}
612614
613615
.header {
614-
font-size: 12px;
616+
font-size: var(--font-size-base);
615617
font-weight: bold;
616618
}
617-
.header.vscode-dark {
619+
620+
.vscode-dark .header {
618621
color: white;
619622
}
620-
.header.vscode-light {
623+
.vscode-light .header {
621624
color: black;
622625
}
623626
624627
.title {
625628
margin-bottom: 3px;
626629
margin-top: 3px;
627-
font-size: 11px;
630+
font-size: var(--font-size-base);
628631
font-weight: 500;
629632
}
630-
.title.vscode-dark {
633+
.vscode-dark .title {
631634
color: white;
632635
}
633-
.title.vscode-light {
636+
.vscode-light .title {
634637
color: black;
635638
}
636639
637640
.subHeader {
638-
font-size: 10px;
641+
font-size: var(--font-size-sm);
639642
}
640643
.continue-button {
641644
background-color: var(--vscode-button-background);
@@ -648,6 +651,7 @@ export default defineComponent({
648651
margin-bottom: 3px;
649652
margin-top: 3px;
650653
cursor: pointer;
654+
font-size: var(--font-size-base);
651655
}
652656
.back-button {
653657
background: none;
@@ -677,7 +681,7 @@ export default defineComponent({
677681
padding-right: 8px;
678682
padding-top: 6px;
679683
padding-bottom: 6px;
680-
font-size: 13px;
684+
font-size: var(--font-size-base);
681685
font-weight: 400;
682686
}
683687
body.vscode-light .urlInput {
@@ -696,7 +700,7 @@ body.vscode-dark .urlInput {
696700
padding-right: 8px;
697701
padding-top: 6px;
698702
padding-bottom: 6px;
699-
font-size: 13px;
703+
font-size: var(--font-size-base);
700704
font-weight: 400;
701705
}
702706
body.vscode-light .iamInput {
@@ -714,18 +718,18 @@ body.vscode-dark .iamInput {
714718
padding-right: 8px;
715719
padding-top: 6px;
716720
padding-bottom: 6px;
717-
font-size: 13px;
721+
font-size: var(--font-size-base);
718722
font-weight: 400;
719723
}
720724
body.vscode-light .regionSelect {
721725
color: black;
722726
}
723727
body.vscode-dark .regionSelect {
724-
color: #cccccc;
728+
color: white;
725729
}
726730
.start-url-error {
727731
color: #ff0000;
728-
font-size: 8px;
732+
font-size: var(--font-size-sm);
729733
}
730734
#logo {
731735
fill: var(--vscode-button-foreground);

packages/core/src/login/webview/vue/selectableItem.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,21 +117,20 @@ export default defineComponent({
117117
}
118118
119119
.title {
120-
font-size: 12px;
121-
font-weight: bold;
120+
font-size: var(--font-size-base);
122121
}
123122
124123
.text {
125124
display: flex;
126125
flex-direction: column;
127-
font-size: 12px;
126+
font-size: var(--font-size-sm);
128127
justify-content: center;
129128
}
130129
131-
.text.vscode-dark {
130+
.vscode-dark .text {
132131
color: white;
133132
}
134-
.text.vscode-light {
133+
.vscode-light .text {
135134
color: black;
136135
}
137136
.icon {

0 commit comments

Comments
 (0)