@@ -10,11 +10,11 @@ const colors = {
1010 backgroundColorRgb : 'var(--ion-background-color-rgb, 255, 255, 255)' ,
1111 textColor : 'var(--ion-text-color, #000)' ,
1212 textColorRgb : 'var(--ion-text-color-rgb, 0, 0, 0)' ,
13- }
13+ } ;
1414
1515const fontSizes = {
1616 chipBase : 14 ,
17- }
17+ } ;
1818
1919export const defaultTheme : DefaultTheme = {
2020 ...baseDefaultTheme ,
@@ -84,119 +84,118 @@ export const defaultTheme: DefaultTheme = {
8484 xxxxl : 'var(--ion-radii-full)' ,
8585 } ,
8686
87-
8887 components : {
89- IonChip : {
90- margin : '4px' ,
91- paddingVertical : '6px' ,
92- paddingHorizontal : '12px' ,
93-
94- // Sizes
95- size : {
96- small : {
97- height : '24px' ,
98- fontSize : clamp ( '12px' , `${ ( fontSizes . chipBase - 2 ) / 16 } rem` , '20px' ) ,
99- } ,
100- medium : {
101- height : '32px' ,
102- fontSize : clamp ( '13px' , `${ fontSizes . chipBase / 16 } rem` , '22px' ) ,
103- } ,
104- large : {
105- height : '32px' ,
106- fontSize : clamp ( '14px' , `${ ( fontSizes . chipBase + 2 ) / 16 } rem` , '24px' ) ,
107- } ,
88+ IonChip : {
89+ margin : '4px' ,
90+ paddingVertical : '6px' ,
91+ paddingHorizontal : '12px' ,
92+
93+ // Sizes
94+ size : {
95+ small : {
96+ height : '24px' ,
97+ fontSize : clamp ( '12px' , `${ ( fontSizes . chipBase - 2 ) / 16 } rem` , '20px' ) ,
10898 } ,
109-
110- // States
111- state : {
112- disabled : {
113- opacity : '0.4' ,
114- } ,
115- focus : {
116- bg : rgba ( colors . textColorRgb , 0.16 ) ,
117- semanticBg : currentColor ( 'base' , 0.12 ) ,
118- outlineBg : rgba ( colors . textColorRgb , 0.04 ) ,
119- } ,
120- activated : {
121- bg : rgba ( colors . textColorRgb , 0.2 ) ,
122- semanticBg : currentColor ( 'base' , 0.16 ) ,
123- } ,
124- hover : {
125- bg : rgba ( colors . textColorRgb , 0.16 ) ,
126- semanticBg : currentColor ( 'base' , 0.12 ) ,
127- outlineBg : rgba ( colors . textColorRgb , 0.04 ) ,
128- } ,
99+ medium : {
100+ height : '32px' ,
101+ fontSize : clamp ( '13px' , `${ fontSizes . chipBase / 16 } rem` , '22px' ) ,
129102 } ,
130-
131- // Shapes
132- shape : {
133- soft : {
134- borderRadius : 'var(--ion-radii-250)' ,
135- } ,
136- round : {
137- borderRadius : 'var(--ion-radii-full)' ,
138- } ,
139- rectangular : {
140- borderRadius : 'var(--ion-radii-0)' ,
141- } ,
103+ large : {
104+ height : '32px' ,
105+ fontSize : clamp ( '14px' , `${ ( fontSizes . chipBase + 2 ) / 16 } rem` , '24px' ) ,
142106 } ,
143-
144- // Hues
145- hue : {
146- bold : {
147- bg : rgba ( colors . textColorRgb , 0.12 ) ,
148- color : rgba ( colors . textColorRgb , 0.87 ) ,
149-
150- outline : {
151- borderColor : rgba ( colors . textColorRgb , 0.32 ) ,
152- } ,
153-
154- // Any of the semantic colors like primary, secondary, etc.
155- semantic : {
156- bgAlpha : '0.08' ,
157- color : currentColor ( 'shade' ) ,
158-
159- outline : {
160- borderColor : currentColor ( 'base' , 0.32 ) ,
161- }
162- } ,
107+ } ,
108+
109+ // States
110+ state : {
111+ disabled : {
112+ opacity : '0.4' ,
113+ } ,
114+ focus : {
115+ bg : rgba ( colors . textColorRgb , 0.16 ) ,
116+ semanticBg : currentColor ( 'base' , 0.12 ) ,
117+ outlineBg : rgba ( colors . textColorRgb , 0.04 ) ,
118+ } ,
119+ activated : {
120+ bg : rgba ( colors . textColorRgb , 0.2 ) ,
121+ semanticBg : currentColor ( 'base' , 0.16 ) ,
122+ } ,
123+ hover : {
124+ bg : rgba ( colors . textColorRgb , 0.16 ) ,
125+ semanticBg : currentColor ( 'base' , 0.12 ) ,
126+ outlineBg : rgba ( colors . textColorRgb , 0.04 ) ,
127+ } ,
128+ } ,
129+
130+ // Shapes
131+ shape : {
132+ soft : {
133+ borderRadius : 'var(--ion-radii-250)' ,
134+ } ,
135+ round : {
136+ borderRadius : 'var(--ion-radii-full)' ,
137+ } ,
138+ rectangular : {
139+ borderRadius : 'var(--ion-radii-0)' ,
140+ } ,
141+ } ,
142+
143+ // Hues
144+ hue : {
145+ bold : {
146+ bg : rgba ( colors . textColorRgb , 0.12 ) ,
147+ color : rgba ( colors . textColorRgb , 0.87 ) ,
148+
149+ outline : {
150+ borderColor : rgba ( colors . textColorRgb , 0.32 ) ,
163151 } ,
164- subtle : {
165- bg : rgba ( colors . textColorRgb , 0.04 ) ,
166- color : rgba ( colors . textColorRgb , 0.87 ) ,
167-
152+
153+ // Any of the semantic colors like primary, secondary, etc.
154+ semantic : {
155+ bgAlpha : '0.08' ,
156+ color : currentColor ( 'shade' ) ,
157+
168158 outline : {
169- borderColor : rgba ( colors . textColorRgb , 0.32 ) ,
159+ borderColor : currentColor ( 'base' , 0.32 ) ,
170160 } ,
171161 } ,
172162 } ,
173-
174- // Variants
175- variant : {
163+ subtle : {
164+ bg : rgba ( colors . textColorRgb , 0.04 ) ,
165+ color : rgba ( colors . textColorRgb , 0.87 ) ,
166+
176167 outline : {
177- borderWidth : '1px' ,
178- bg : 'transparent' ,
168+ borderColor : rgba ( colors . textColorRgb , 0.32 ) ,
179169 } ,
180170 } ,
181-
182- icon : {
183- size : `${ 20 / fontSizes . chipBase } em` ,
184- color : rgba ( colors . textColorRgb , 0.54 ) ,
185- firstChildMargin : '-4px' ,
186- firstChildMarginEnd : '8px' ,
187- lastChildMargin : '-4px' ,
188- lastChildMarginStart : '8px' ,
189- } ,
190-
191- avatar : {
192- size : `${ 24 / fontSizes . chipBase } em` ,
193- firstChildMarginVertical : '-4px' ,
194- firstChildMarginStart : '-8px' ,
195- firstChildMarginEnd : '8px' ,
196- lastChildMarginVertical : '-4px' ,
197- lastChildMarginStart : '8px' ,
198- lastChildMarginEnd : '-8px' ,
171+ } ,
172+
173+ // Variants
174+ variant : {
175+ outline : {
176+ borderWidth : '1px' ,
177+ bg : 'transparent' ,
199178 } ,
200179 } ,
201- }
180+
181+ icon : {
182+ size : `${ 20 / fontSizes . chipBase } em` ,
183+ color : rgba ( colors . textColorRgb , 0.54 ) ,
184+ firstChildMargin : '-4px' ,
185+ firstChildMarginEnd : '8px' ,
186+ lastChildMargin : '-4px' ,
187+ lastChildMarginStart : '8px' ,
188+ } ,
189+
190+ avatar : {
191+ size : `${ 24 / fontSizes . chipBase } em` ,
192+ firstChildMarginVertical : '-4px' ,
193+ firstChildMarginStart : '-8px' ,
194+ firstChildMarginEnd : '8px' ,
195+ lastChildMarginVertical : '-4px' ,
196+ lastChildMarginStart : '8px' ,
197+ lastChildMarginEnd : '-8px' ,
198+ } ,
199+ } ,
200+ } ,
202201} ;
0 commit comments