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

Function controlBorderRadius

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

Source from the content-addressed store, hash-verified

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