1- import * as colorTokens from 'outsystems-design-tokens/tokens/color scheme.json' ;
2- import * as primitiveTokens from 'outsystems-design-tokens/tokens/primitives.json' ;
3- import * as lightTokens from 'outsystems-design-tokens/tokens/theme/light.json' ;
4- import * as typographyTokens from 'outsystems-design-tokens/tokens/typography.json' ;
5-
6- import { currentColor , cachedResolveOsToken } from '../../utils/theme' ;
1+ import { rgba , currentColor } from '../../utils/theme' ;
72import { defaultTheme as baseDefaultTheme } from '../base/default.tokens' ;
83import type { DefaultTheme } from '../themes.interfaces' ;
94
105import { darkTheme } from './dark.tokens' ;
116import { lightTheme } from './light.tokens' ;
127
13- const tokenMap = {
14- colorTokens ,
15- primitiveTokens ,
16- lightTokens ,
17- typographyTokens ,
8+ const colors = {
9+ backgroundColor : 'var(--ion-background-color, #fff)' ,
10+ backgroundColorRgb : 'var(--ion-background-color-rgb, 255, 255, 255)' ,
11+ textColor : 'var(--ion-text-color, #000)' ,
12+ textColorRgb : 'var(--ion-text-color-rgb, 0, 0, 0)' ,
1813} ;
1914
2015export const defaultTheme : DefaultTheme = {
@@ -96,26 +91,38 @@ export const defaultTheme: DefaultTheme = {
9691 cursor : 'auto' ,
9792
9893 padding : {
99- vertical : primitiveTokens . scale [ '150' ] . $value ,
100- horizontal : primitiveTokens . scale [ '200' ] . $value ,
94+ vertical : '6px' ,
95+ horizontal : '8px' ,
10196 } ,
10297
103- typography : cachedResolveOsToken ( typographyTokens . body . sm . medium . $value , tokenMap ) ,
104- lineHeight : primitiveTokens . font [ 'line-height' ] [ 'full' ] . $value ,
105- gap : cachedResolveOsToken ( primitiveTokens . space [ '100' ] . $value , tokenMap ) ,
98+ lineHeight : '20px' ,
99+ gap : '4px' ,
100+
101+ typography : {
102+ fontFamily :
103+ '-apple-system, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"' ,
104+ fontWeight : 500 ,
105+ lineHeight : '20px' ,
106+ fontSize : '12px' ,
107+ letterSpacing : '0%' ,
108+ paragraphSpacing : 20 ,
109+ paragraphIndent : 0 ,
110+ textCase : 'none' ,
111+ textDecoration : 'none' ,
112+ } ,
106113
107114 // Sizes
108115 size : {
109116 small : {
110- minHeight : primitiveTokens . scale [ '600' ] . $value ,
117+ minHeight : '24px' ,
111118 font : {
112- size : primitiveTokens . font [ 'font-size' ] [ '300' ] . $value ,
119+ size : '12px' ,
113120 } ,
114121 } ,
115122 large : {
116- minHeight : primitiveTokens . scale [ '800' ] . $value ,
123+ minHeight : '32px' ,
117124 font : {
118- size : primitiveTokens . font [ 'font-size' ] [ '350' ] . $value ,
125+ size : '14px' ,
119126 } ,
120127 } ,
121128 } ,
@@ -127,8 +134,8 @@ export const defaultTheme: DefaultTheme = {
127134 } ,
128135 focus : {
129136 ring : {
130- color : lightTokens . primitives . blue [ '400' ] . $value ,
131- width : primitiveTokens . scale [ '050' ] . $value ,
137+ color : '#b5c0f7' ,
138+ width : '2px' ,
132139 } ,
133140 } ,
134141 } ,
@@ -137,26 +144,26 @@ export const defaultTheme: DefaultTheme = {
137144 shape : {
138145 soft : {
139146 border : {
140- radius : primitiveTokens . scale [ '100' ] . $value ,
147+ radius : '4px' ,
141148 } ,
142149 } ,
143150 round : {
144151 border : {
145- radius : primitiveTokens . scale [ '400' ] . $value ,
152+ radius : '16px' ,
146153 } ,
147154 } ,
148155 rectangular : {
149156 border : {
150- radius : primitiveTokens . scale [ '0' ] . $value ,
157+ radius : '0px' ,
151158 } ,
152159 } ,
153160 } ,
154161
155162 // Hues
156163 hue : {
157164 bold : {
158- bg : cachedResolveOsToken ( colorTokens . bg . neutral . bold . default , tokenMap ) ,
159- color : cachedResolveOsToken ( colorTokens . bg . surface . default , tokenMap ) ,
165+ bg : rgba ( colors . textColorRgb , 0.12 ) ,
166+ color : rgba ( colors . textColorRgb , 0.87 ) ,
160167
161168 // Any of the semantic colors like primary, secondary, etc.
162169 semantic : {
@@ -166,8 +173,8 @@ export const defaultTheme: DefaultTheme = {
166173 } ,
167174
168175 subtle : {
169- bg : cachedResolveOsToken ( lightTokens . primitives . neutral [ '100' ] , tokenMap ) ,
170- color : lightTokens . primitives . neutral [ '800' ] . $value ,
176+ bg : rgba ( colors . textColorRgb , 0.05 ) ,
177+ color : rgba ( colors . textColorRgb , 0.6 ) ,
171178
172179 semantic : {
173180 color : currentColor ( 'contrast' , null , true ) , // ADD THIS TO THE COMPONENT SCSS
@@ -181,11 +188,11 @@ export const defaultTheme: DefaultTheme = {
181188 outline : {
182189 border : {
183190 color : {
184- bold : cachedResolveOsToken ( colorTokens . text . default , tokenMap ) ,
185- subtle : cachedResolveOsToken ( lightTokens . primitives . neutral [ '300' ] , tokenMap ) ,
191+ bold : rgba ( colors . textColorRgb , 0.32 ) ,
192+ subtle : rgba ( colors . textColorRgb , 0.16 ) ,
186193 } ,
187194
188- width : primitiveTokens . scale [ '025' ] . $value ,
195+ width : '1px' ,
189196 } ,
190197
191198 semantic : {
@@ -200,7 +207,7 @@ export const defaultTheme: DefaultTheme = {
200207 } ,
201208
202209 icon : {
203- size : primitiveTokens . font [ 'font-size' ] [ '400' ] . $value ,
210+ size : '16px' ,
204211 } ,
205212 } ,
206213 } ,
0 commit comments