MCPcopy Create free account
hub / github.com/adobe/react-spectrum / controlBorderRadius

Function controlBorderRadius

packages/@react-spectrum/s2/src/style-utils.ts:244–263  ·  view source on GitHub ↗
(size: 'default' | 'sm' = 'default')

Source from the content-addressed store, hash-verified

242// This generates the border radius for t-shirt sizes using the
243// Major Second logarithmic scale.
244export const controlBorderRadius = (size: 'default' | 'sm' = 'default') =>
245 ({
246 '--size': {
247 type: 'order',
248 value: {
249 default: 1,
250 size: {
251 XS: Math.pow(1.125, -2),
252 S: Math.pow(1.125, -1),
253 L: Math.pow(1.125, 1),
254 XL: Math.pow(1.125, 2)
255 }
256 }
257 },
258 '--radius': {
259 type: 'borderTopStartRadius',
260 value: size
261 },
262 borderRadius: 'round(var(--radius) * var(--size), 1px)'
263 }) as const;
264
265interface ControlOptions {
266 shape?: 'default' | 'pill';

Callers 6

NumberField.tsxFile · 0.90
DatePicker.tsxFile · 0.90
ComboBox.tsxFile · 0.90
Checkbox.tsxFile · 0.90
Picker.tsxFile · 0.90
controlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected