1
>
/*---------------------------------------------------------------------------------------------
baseSizes.ts
2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
6
>
import * as nls from '../../../../nls.js';
7
>
import { registerSize, sizeForAllThemes } from '../sizeUtils.js';
8
>
9
>
// ------ Font Sizes
10
>
11
>
/** @deprecated Use {@link fontSizeBody1} instead. */
12
>
export const bodyFontSize = registerSize('bodyFontSize',
13
>
sizeForAllThemes(13, 'px'),
14
>
nls.localize('bodyFontSize', "Base font size. This size is used if not overridden by a component."),
15
>
nls.localize('bodyFontSize.deprecated', "Deprecated: use `fontSize.body1` instead."));
16
>
17
>
/** @deprecated Use {@link fontSizeLabel1} instead. */
18
>
export const bodyFontSizeSmall = registerSize('bodyFontSize.small',
19
>
sizeForAllThemes(12, 'px'),
20
>
nls.localize('bodyFontSizeSmall', "Small font size for secondary content."),
21
>
nls.localize('bodyFontSizeSmall.deprecated', "Deprecated: use `fontSize.label1` instead."));
22
>
23
>
/** @deprecated Use {@link fontSizeBody2} instead. */
24
>
export const bodyFontSizeXSmall = registerSize('bodyFontSize.xSmall',
25
>
sizeForAllThemes(11, 'px'),
26
>
nls.localize('bodyFontSizeXSmall', "Extra small font size for less prominent content."),
27
>
nls.localize('bodyFontSizeXSmall.deprecated', "Deprecated: use `fontSize.body2` instead."));
28
>
29
>
// ------ Font ramp
30
>
//
31
>
// A generic font-size ramp (headings, body and labels) mirroring the agents
32
>
// window ramp. "Strong" variants are NOT separate size tokens: reuse the
33
>
// matching size token paired with `fontWeight.semiBold` (600). Regular text
34
>
// pairs with `fontWeight.regular` (400).
35
>
36
>
export const fontSizeHeading1 = registerSize('fontSize.heading1',
37
>
sizeForAllThemes(26, 'px'),
38
>
nls.localize('fontSizeHeading1', "Heading 1 font size (largest heading)."));
39
>
40
>
export const fontSizeHeading2 = registerSize('fontSize.heading2',
41
>
sizeForAllThemes(18, 'px'),
42
>
nls.localize('fontSizeHeading2', "Heading 2 font size (title)."));
43
>
44
>
export const fontSizeHeading3 = registerSize('fontSize.heading3',
45
>
sizeForAllThemes(13, 'px'),
46
>
nls.localize('fontSizeHeading3', "Heading 3 font size (subtitle)."));
47
>
48
>
export const fontSizeBody1 = registerSize('fontSize.body1',
49
>
sizeForAllThemes(13, 'px'),
50
>
nls.localize('fontSizeBody1', "Primary body font size."));
51
>
52
>
export const fontSizeBody2 = registerSize('fontSize.body2',
53
>
sizeForAllThemes(11, 'px'),
54
>
nls.localize('fontSizeBody2', "Secondary body font size."));
55
>
56
>
export const fontSizeLabel1 = registerSize('fontSize.label1',
57
>
sizeForAllThemes(12, 'px'),
58
>
nls.localize('fontSizeLabel1', "Label 1 font size (section title, tabs)."));
59
>
60
>
export const fontSizeLabel2 = registerSize('fontSize.label2',
61
>
sizeForAllThemes(11, 'px'),
62
>
nls.localize('fontSizeLabel2', "Label 2 font size (metadata)."));
63
>
64
>
export const fontSizeLabel3 = registerSize('fontSize.label3',
65
>
sizeForAllThemes(10, 'px'),
66
>
nls.localize('fontSizeLabel3', "Label 3 font size (badge)."));
67
>
68
>
// ------ Font weights
69
>
//
70
>
// A two-weight ramp (regular/semiBold). "Strong" emphasis reuses the matching
71
>
// font-size token paired with `fontWeight.semiBold`.
72
>
73
>
export const fontWeightRegular = registerSize('fontWeight.regular',
74
>
sizeForAllThemes(400, ''),
75
>
nls.localize('fontWeightRegular', "Regular font weight (400) for body, labels and metadata."));
76
>
77
>
export const fontWeightSemiBold = registerSize('fontWeight.semiBold',
78
>
sizeForAllThemes(600, ''),
79
>
nls.localize('fontWeightSemiBold', "SemiBold font weight (600) for headings and strong emphasis."));
80
>
81
>
export const codiconFontSize = registerSize('codiconFontSize',
82
>
sizeForAllThemes(16, 'px'),
83
>
nls.localize('codiconFontSize', "Base font size for codicons."));
84
>
85
>
export const codiconFontSizeCompact = registerSize('codiconFontSize.compact',
86
>
sizeForAllThemes(12, 'px'),
87
>
nls.localize('codiconFontSizeCompact', "Compact font size for codicons."));
88
>
89
>
// ------ Corner Radii
90
>
91
>
export const cornerRadiusMedium = registerSize('cornerRadius.medium',
92
>
sizeForAllThemes(6, 'px'),
93
>
nls.localize('cornerRadiusMedium', "Base corner radius for UI elements."));
94
>
95
>
export const cornerRadiusXSmall = registerSize('cornerRadius.xSmall',
96
>
sizeForAllThemes(2, 'px'),
97
>
nls.localize('cornerRadiusXSmall', "Extra small corner radius for very compact UI elements."));
98
>
99
>
export const cornerRadiusSmall = registerSize('cornerRadius.small',
100
>
sizeForAllThemes(4, 'px'),
101
>
nls.localize('cornerRadiusSmall', "Small corner radius for compact UI elements."));
102
>
103
>
export const cornerRadiusLarge = registerSize('cornerRadius.large',
104
>
sizeForAllThemes(8, 'px'),
105
>
nls.localize('cornerRadiusLarge', "Large corner radius for prominent UI elements."));
106
>
107
>
export const cornerRadiusXLarge = registerSize('cornerRadius.xLarge',
108
>
sizeForAllThemes(12, 'px'),
109
>
nls.localize('cornerRadiusXLarge', "Extra large corner radius for very prominent UI elements."));
110
>
111
>
export const cornerRadiusCircle = registerSize('cornerRadius.circle',
112
>
sizeForAllThemes(9999, 'px'),
113
>
nls.localize('cornerRadiusCircle', "Circular corner radius for fully rounded UI elements."));
114
>
115
>
// ------ Stroke Thickness
116
>
117
>
export const strokeThickness = registerSize('strokeThickness',
118
>
sizeForAllThemes(1, 'px'),
119
>
nls.localize('strokeThickness', "Base stroke thickness for borders and outlines."));
120
>
121
>
// ------ Spacing ramp
122
>
//
123
>
// A fixed ramp of spacing tokens used for padding, margins and gaps. Numeric tokens
124
>
// encode the value in tenths of a pixel (e.g. `size200` is 20px). `sizeNone`
125
>
// represents 0px, matching the design system's spacing ramp.
126
>
127
>
export const spacingNone = registerSize('spacing.sizeNone',
128
>
sizeForAllThemes(0, 'px'),
129
>
nls.localize('spacingNone', "No spacing (0px)."));
130
>
131
>
export const spacingSize20 = registerSize('spacing.size20',
132
>
sizeForAllThemes(2, 'px'),
133
>
nls.localize('spacingSize20', "Spacing of 2px."));
134
>
135
>
export const spacingSize40 = registerSize('spacing.size40',
136
>
sizeForAllThemes(4, 'px'),
137
>
nls.localize('spacingSize40', "Spacing of 4px."));
138
>
139
>
export const spacingSize60 = registerSize('spacing.size60',
140
>
sizeForAllThemes(6, 'px'),
141
>
nls.localize('spacingSize60', "Spacing of 6px."));
142
>
143
>
export const spacingSize80 = registerSize('spacing.size80',
144
>
sizeForAllThemes(8, 'px'),
145
>
nls.localize('spacingSize80', "Spacing of 8px."));
146
>
147
>
export const spacingSize100 = registerSize('spacing.size100',
148
>
sizeForAllThemes(10, 'px'),
149
>
nls.localize('spacingSize100', "Spacing of 10px."));
150
>
151
>
export const spacingSize120 = registerSize('spacing.size120',
152
>
sizeForAllThemes(12, 'px'),
153
>
nls.localize('spacingSize120', "Spacing of 12px."));
154
>
155
>
export const spacingSize160 = registerSize('spacing.size160',
156
>
sizeForAllThemes(16, 'px'),
157
>
nls.localize('spacingSize160', "Spacing of 16px."));
158
>
159
>
export const spacingSize200 = registerSize('spacing.size200',
160
>
sizeForAllThemes(20, 'px'),
161
>
nls.localize('spacingSize200', "Spacing of 20px."));
162
>
163
>
export const spacingSize240 = registerSize('spacing.size240',
164
>
sizeForAllThemes(24, 'px'),
165
>
nls.localize('spacingSize240', "Spacing of 24px."));
166
>
167
>
export const spacingSize280 = registerSize('spacing.size280',
168
>
sizeForAllThemes(28, 'px'),
169
>
nls.localize('spacingSize280', "Spacing of 28px."));
170
>
171
>
export const spacingSize320 = registerSize('spacing.size320',
172
>
sizeForAllThemes(32, 'px'),
173
>
nls.localize('spacingSize320', "Spacing of 32px."));
174
>
175
>
export const spacingSize360 = registerSize('spacing.size360',
176
>
sizeForAllThemes(36, 'px'),
177
>
nls.localize('spacingSize360', "Spacing of 36px."));
178
>
179
>
export const spacingSize400 = registerSize('spacing.size400',
180
>
sizeForAllThemes(40, 'px'),
181
>
nls.localize('spacingSize400', "Spacing of 40px."));