File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ class Builder implements IBuilder {
101
101
102
102
if ( cornerRadius !== figma . mixed ) {
103
103
if ( cornerRadius !== 0 ) {
104
- const dimensionHandler = createDimensionHandler ( this . config . dimensionsLookup , this . config . nearestInference , this . config . unit )
104
+ const dimensionHandler = createDimensionHandler ( this . config . borderRadiusLookup , this . config . nearestInference , this . config . unit )
105
105
this . attributes . add ( `rounded-${ translateUtilityValue ( dimensionHandler ( cornerRadius ) ) } ` )
106
106
}
107
107
}
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import { createDimensionLookup } from './dimension'
9
9
interface LookupCache {
10
10
color : InferenceColorMap | null
11
11
dimensions : InferenceDimensionMap | null
12
- borderDimensions : InferenceDimensionMap | null
12
+ borderRadiusDimensions : InferenceDimensionMap | null
13
13
}
14
14
15
15
const defaultConfig : IConfiguration = {
@@ -45,7 +45,7 @@ export class Configuration implements IConfiguration {
45
45
private lookupCache : LookupCache = {
46
46
color : null ,
47
47
dimensions : null ,
48
- borderDimensions : null ,
48
+ borderRadiusDimensions : null ,
49
49
}
50
50
51
51
constructor (
@@ -102,4 +102,20 @@ export class Configuration implements IConfiguration {
102
102
103
103
return lookup
104
104
}
105
+
106
+ /**
107
+ * Retrieves the border radius lookup for the component.
108
+ * If the lookup cache already contains the border dimensions, it returns the cached value.
109
+ * Otherwise, it creates and caches the border dimensions using the theme's border radius.
110
+ * @return {InferenceDimensionMap } - The border radius lookup
111
+ */
112
+ public get borderRadiusLookup ( ) : InferenceDimensionMap {
113
+ if ( this . lookupCache . borderRadiusDimensions )
114
+ return this . lookupCache . borderRadiusDimensions
115
+
116
+ const lookup = createDimensionLookup ( this . theme . borderRadius || { } )
117
+ this . lookupCache . borderRadiusDimensions = lookup
118
+
119
+ return lookup
120
+ }
105
121
}
You can’t perform that action at this time.
0 commit comments