@vkontakte/vkui-tokens 4.0.0-rc.8 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +108 -42
- package/build/compilers/index.js +3 -1
- package/build/compilers/styles/compileStyles.d.ts +2 -1
- package/build/compilers/styles/compileStyles.js +15 -3
- package/build/compilers/styles/compileStyles.test.js +43 -1
- package/build/compilers/styles/helpers/tokenRecognition.d.ts +1 -0
- package/build/compilers/styles/helpers/tokenRecognition.js +6 -1
- package/build/expandTheme.test.js +4 -4
- package/build/helpers/convertCamelToSnake.js +1 -1
- package/build/helpers/convertCamelToSnake.test.js +3 -0
- package/build/helpers/cssHelpers.d.ts +12 -1
- package/build/helpers/cssHelpers.js +35 -2
- package/build/helpers/cssHelpers.test.js +12 -0
- package/build/helpers/getAllButSizes.d.ts +1 -0
- package/build/helpers/getAllButSizes.js +17 -0
- package/build/helpers/getAllButSizes.test.d.ts +1 -0
- package/build/helpers/getAllButSizes.test.js +22 -0
- package/build/helpers/getOnlyColors.test.d.ts +1 -0
- package/build/helpers/getOnlyColors.test.js +17 -0
- package/build/themeProcessors/expandColors/expandColors.d.ts +4 -1
- package/build/themeProcessors/expandColors/expandColors.js +24 -14
- package/build/themeProcessors/expandColors/overlayColors.d.ts +4 -0
- package/build/themeProcessors/expandColors/overlayColors.js +27 -0
- package/build/themeProcessors/expandColors/overlayColors.test.d.ts +1 -0
- package/build/themeProcessors/expandColors/overlayColors.test.js +37 -0
- package/build/themeProcessors/pixelifyValues/pixelifyValues.js +2 -2
- package/build/themeProcessors/pixelifyValues/pixelifyValues.test.js +5 -0
- package/interfaces/general/colors/index.d.ts +26 -13
- package/interfaces/general/geometry/index.d.ts +2 -0
- package/interfaces/general/index.d.ts +1 -0
- package/interfaces/general/toneValues/index.d.ts +1 -0
- package/interfaces/namespaces/paradigm/index.d.ts +4 -33
- package/interfaces/themes/calendar/index.d.ts +11 -3
- package/interfaces/themes/calls/index.d.ts +4 -4
- package/interfaces/themes/cloud/index.d.ts +4 -4
- package/interfaces/themes/home/index.d.ts +20 -9
- package/interfaces/themes/media/index.d.ts +28 -11
- package/interfaces/themes/mediaDark/index.d.ts +4 -0
- package/interfaces/themes/mediaDark/index.js +2 -0
- package/interfaces/themes/octavius/index.d.ts +177 -4
- package/interfaces/themes/octaviusVK/index.d.ts +4 -0
- package/interfaces/themes/octaviusVK/index.js +2 -0
- package/interfaces/themes/octaviusVKDark/index.d.ts +4 -0
- package/interfaces/themes/octaviusVKDark/index.js +2 -0
- package/interfaces/themes/octaviusWhite/index.d.ts +4 -0
- package/interfaces/themes/octaviusWhite/index.js +2 -0
- package/interfaces/themes/paradigmBase/index.d.ts +4 -4
- package/interfaces/themes/paradigmBaseDark/index.d.ts +4 -4
- package/interfaces/themes/pharma/index.d.ts +2 -2
- package/interfaces/themes/vkBaseDark/index.d.ts +7 -0
- package/interfaces/themes/vkBaseDark/index.js +2 -0
- package/interfaces/themes/vkCom/index.d.ts +1 -0
- package/interfaces/themes/vkCom/index.js +2 -0
- package/interfaces/themes/vkIOS/index.d.ts +1 -0
- package/interfaces/themes/vkIOS/index.js +2 -0
- package/package.json +4 -1
- package/themeDescriptions/base/paradigm.d.ts +7 -2
- package/themeDescriptions/base/paradigm.js +326 -106
- package/themeDescriptions/base/vk.d.ts +2 -0
- package/themeDescriptions/base/vk.js +149 -33
- package/themes/calendar/cssVars/declarations/index.css +178 -240
- package/themes/calendar/cssVars/declarations/noSizes.css +268 -0
- package/themes/calendar/cssVars/declarations/onlyColors.css +156 -228
- package/themes/calendar/cssVars/declarations/onlyColors.js +2 -2
- package/themes/calendar/cssVars/declarations/onlyMedia.css +6 -2
- package/themes/calendar/cssVars/declarations/onlyVariables.css +172 -238
- package/themes/calendar/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/calendar/cssVars/theme/fallbacks/index.css +174 -240
- package/themes/calendar/cssVars/theme/fallbacks/index.less +174 -240
- package/themes/calendar/cssVars/theme/fallbacks/index.pcss +174 -240
- package/themes/calendar/cssVars/theme/fallbacks/index.scss +174 -240
- package/themes/calendar/cssVars/theme/fallbacks/index.styl +174 -240
- package/themes/calendar/cssVars/theme/index.js +598 -890
- package/themes/calendar/cssVars/theme/index.json +598 -890
- package/themes/calendar/index.css +172 -238
- package/themes/calendar/index.js +227 -334
- package/themes/calendar/index.json +227 -334
- package/themes/calendar/index.less +172 -238
- package/themes/calendar/index.pcss +172 -238
- package/themes/calendar/index.scss +172 -238
- package/themes/calendar/index.styl +172 -238
- package/themes/calendarDark/cssVars/declarations/index.css +190 -252
- package/themes/calendarDark/cssVars/declarations/noSizes.css +268 -0
- package/themes/calendarDark/cssVars/declarations/onlyColors.css +168 -240
- package/themes/calendarDark/cssVars/declarations/onlyColors.js +2 -2
- package/themes/calendarDark/cssVars/declarations/onlyMedia.css +6 -2
- package/themes/calendarDark/cssVars/declarations/onlyVariables.css +184 -250
- package/themes/calendarDark/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/calendarDark/cssVars/theme/fallbacks/index.css +186 -252
- package/themes/calendarDark/cssVars/theme/fallbacks/index.less +186 -252
- package/themes/calendarDark/cssVars/theme/fallbacks/index.pcss +186 -252
- package/themes/calendarDark/cssVars/theme/fallbacks/index.scss +186 -252
- package/themes/calendarDark/cssVars/theme/fallbacks/index.styl +186 -252
- package/themes/calendarDark/cssVars/theme/index.js +604 -896
- package/themes/calendarDark/cssVars/theme/index.json +604 -896
- package/themes/calendarDark/index.css +184 -250
- package/themes/calendarDark/index.js +257 -364
- package/themes/calendarDark/index.json +257 -364
- package/themes/calendarDark/index.less +184 -250
- package/themes/calendarDark/index.pcss +184 -250
- package/themes/calendarDark/index.scss +184 -250
- package/themes/calendarDark/index.styl +184 -250
- package/themes/calls/cssVars/declarations/index.css +201 -258
- package/themes/calls/cssVars/declarations/noSizes.css +268 -0
- package/themes/calls/cssVars/declarations/onlyColors.css +168 -240
- package/themes/calls/cssVars/declarations/onlyColors.js +2 -2
- package/themes/calls/cssVars/declarations/onlyMedia.css +11 -3
- package/themes/calls/cssVars/declarations/onlyVariables.css +190 -255
- package/themes/calls/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/calls/cssVars/theme/fallbacks/index.css +192 -257
- package/themes/calls/cssVars/theme/fallbacks/index.less +192 -257
- package/themes/calls/cssVars/theme/fallbacks/index.pcss +192 -257
- package/themes/calls/cssVars/theme/fallbacks/index.scss +192 -257
- package/themes/calls/cssVars/theme/fallbacks/index.styl +192 -257
- package/themes/calls/cssVars/theme/index.js +613 -901
- package/themes/calls/cssVars/theme/index.json +613 -901
- package/themes/calls/index.css +190 -255
- package/themes/calls/index.js +263 -369
- package/themes/calls/index.json +263 -369
- package/themes/calls/index.less +190 -255
- package/themes/calls/index.pcss +190 -255
- package/themes/calls/index.scss +190 -255
- package/themes/calls/index.styl +190 -255
- package/themes/cloud/cssVars/declarations/index.css +178 -240
- package/themes/cloud/cssVars/declarations/noSizes.css +268 -0
- package/themes/cloud/cssVars/declarations/onlyColors.css +156 -228
- package/themes/cloud/cssVars/declarations/onlyColors.js +2 -2
- package/themes/cloud/cssVars/declarations/onlyMedia.css +6 -2
- package/themes/cloud/cssVars/declarations/onlyVariables.css +172 -238
- package/themes/cloud/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/cloud/cssVars/theme/fallbacks/index.css +174 -240
- package/themes/cloud/cssVars/theme/fallbacks/index.less +174 -240
- package/themes/cloud/cssVars/theme/fallbacks/index.pcss +174 -240
- package/themes/cloud/cssVars/theme/fallbacks/index.scss +174 -240
- package/themes/cloud/cssVars/theme/fallbacks/index.styl +174 -240
- package/themes/cloud/cssVars/theme/index.js +598 -890
- package/themes/cloud/cssVars/theme/index.json +598 -890
- package/themes/cloud/index.css +172 -238
- package/themes/cloud/index.js +227 -334
- package/themes/cloud/index.json +227 -334
- package/themes/cloud/index.less +172 -238
- package/themes/cloud/index.pcss +172 -238
- package/themes/cloud/index.scss +172 -238
- package/themes/cloud/index.styl +172 -238
- package/themes/home/cssVars/declarations/index.css +382 -278
- package/themes/home/cssVars/declarations/noSizes.css +286 -0
- package/themes/home/cssVars/declarations/onlyColors.css +171 -228
- package/themes/home/cssVars/declarations/onlyColors.js +2 -2
- package/themes/home/cssVars/declarations/onlyMedia.css +135 -31
- package/themes/home/cssVars/declarations/onlyVariables.css +215 -245
- package/themes/home/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/home/cssVars/theme/fallbacks/index.css +249 -249
- package/themes/home/cssVars/theme/fallbacks/index.less +241 -247
- package/themes/home/cssVars/theme/fallbacks/index.pcss +234 -248
- package/themes/home/cssVars/theme/fallbacks/index.scss +279 -249
- package/themes/home/cssVars/theme/fallbacks/index.styl +241 -247
- package/themes/home/cssVars/theme/index.js +767 -879
- package/themes/home/cssVars/theme/index.json +767 -879
- package/themes/home/index.css +247 -247
- package/themes/home/index.js +300 -347
- package/themes/home/index.json +300 -347
- package/themes/home/index.less +239 -245
- package/themes/home/index.pcss +232 -246
- package/themes/home/index.scss +277 -247
- package/themes/home/index.styl +239 -245
- package/themes/homeDark/cssVars/declarations/index.css +437 -333
- package/themes/homeDark/cssVars/declarations/noSizes.css +286 -0
- package/themes/homeDark/cssVars/declarations/onlyColors.css +225 -282
- package/themes/homeDark/cssVars/declarations/onlyColors.js +2 -2
- package/themes/homeDark/cssVars/declarations/onlyMedia.css +135 -31
- package/themes/homeDark/cssVars/declarations/onlyVariables.css +270 -300
- package/themes/homeDark/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/homeDark/cssVars/theme/fallbacks/index.css +304 -304
- package/themes/homeDark/cssVars/theme/fallbacks/index.less +296 -302
- package/themes/homeDark/cssVars/theme/fallbacks/index.pcss +289 -303
- package/themes/homeDark/cssVars/theme/fallbacks/index.scss +334 -304
- package/themes/homeDark/cssVars/theme/fallbacks/index.styl +296 -302
- package/themes/homeDark/cssVars/theme/index.js +768 -880
- package/themes/homeDark/cssVars/theme/index.json +768 -880
- package/themes/homeDark/index.css +302 -302
- package/themes/homeDark/index.js +377 -424
- package/themes/homeDark/index.json +377 -424
- package/themes/homeDark/index.less +294 -300
- package/themes/homeDark/index.pcss +287 -301
- package/themes/homeDark/index.scss +332 -302
- package/themes/homeDark/index.styl +294 -300
- package/themes/media/cssVars/declarations/index.css +793 -2049
- package/themes/media/cssVars/declarations/noSizes.css +365 -0
- package/themes/media/cssVars/declarations/onlyAdaptiveGroups.css +89 -59
- package/themes/media/cssVars/declarations/onlyColors.css +177 -228
- package/themes/media/cssVars/declarations/onlyColors.js +2 -2
- package/themes/media/cssVars/declarations/onlyMedia.css +169 -900
- package/themes/media/cssVars/declarations/onlyVariables.css +309 -520
- package/themes/media/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/media/cssVars/theme/fallbacks/index.css +546 -1101
- package/themes/media/cssVars/theme/fallbacks/index.less +341 -605
- package/themes/media/cssVars/theme/fallbacks/index.pcss +341 -599
- package/themes/media/cssVars/theme/fallbacks/index.scss +489 -1563
- package/themes/media/cssVars/theme/fallbacks/index.styl +341 -605
- package/themes/media/cssVars/theme/index.js +1149 -1985
- package/themes/media/cssVars/theme/index.json +1149 -1985
- package/themes/media/index.css +527 -1082
- package/themes/media/index.js +441 -728
- package/themes/media/index.json +441 -728
- package/themes/media/index.less +323 -587
- package/themes/media/index.pcss +323 -581
- package/themes/media/index.scss +503 -1577
- package/themes/media/index.styl +323 -587
- package/themes/mediaDark/cssVars/declarations/index.css +1574 -0
- package/themes/mediaDark/cssVars/declarations/noSizes.css +365 -0
- package/themes/mediaDark/cssVars/declarations/onlyAdaptiveGroups.css +153 -0
- package/themes/mediaDark/cssVars/declarations/onlyColors.css +317 -0
- package/themes/mediaDark/cssVars/declarations/onlyColors.d.ts +3 -0
- package/themes/mediaDark/cssVars/declarations/onlyColors.js +11 -0
- package/themes/mediaDark/cssVars/declarations/onlyMedia.css +469 -0
- package/themes/mediaDark/cssVars/declarations/onlyVariables.css +622 -0
- package/themes/mediaDark/cssVars/declarations/onlyVariables.d.ts +3 -0
- package/themes/mediaDark/cssVars/declarations/onlyVariables.js +11 -0
- package/themes/mediaDark/cssVars/theme/fallbacks/index.css +951 -0
- package/themes/mediaDark/cssVars/theme/fallbacks/index.less +722 -0
- package/themes/mediaDark/cssVars/theme/fallbacks/index.pcss +703 -0
- package/themes/mediaDark/cssVars/theme/fallbacks/index.scss +959 -0
- package/themes/mediaDark/cssVars/theme/fallbacks/index.styl +722 -0
- package/themes/mediaDark/cssVars/theme/index.d.ts +4 -0
- package/themes/mediaDark/cssVars/theme/index.js +3900 -0
- package/themes/mediaDark/cssVars/theme/index.json +3897 -0
- package/themes/mediaDark/index.css +951 -0
- package/themes/mediaDark/index.d.ts +4 -0
- package/themes/mediaDark/index.js +1163 -0
- package/themes/mediaDark/index.json +1160 -0
- package/themes/mediaDark/index.less +722 -0
- package/themes/mediaDark/index.pcss +703 -0
- package/themes/mediaDark/index.scss +959 -0
- package/themes/mediaDark/index.styl +722 -0
- package/themes/mycom/cssVars/declarations/index.css +732 -1988
- package/themes/mycom/cssVars/declarations/noSizes.css +368 -0
- package/themes/mycom/cssVars/declarations/onlyAdaptiveGroups.css +89 -59
- package/themes/mycom/cssVars/declarations/onlyColors.css +177 -228
- package/themes/mycom/cssVars/declarations/onlyColors.js +2 -2
- package/themes/mycom/cssVars/declarations/onlyMedia.css +162 -893
- package/themes/mycom/cssVars/declarations/onlyVariables.css +292 -503
- package/themes/mycom/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/mycom/cssVars/theme/fallbacks/index.css +495 -1050
- package/themes/mycom/cssVars/theme/fallbacks/index.less +325 -589
- package/themes/mycom/cssVars/theme/fallbacks/index.pcss +325 -583
- package/themes/mycom/cssVars/theme/fallbacks/index.scss +444 -1518
- package/themes/mycom/cssVars/theme/fallbacks/index.styl +325 -589
- package/themes/mycom/cssVars/theme/index.js +1127 -1963
- package/themes/mycom/cssVars/theme/index.json +1127 -1963
- package/themes/mycom/index.css +465 -1020
- package/themes/mycom/index.js +406 -693
- package/themes/mycom/index.json +406 -693
- package/themes/mycom/index.less +290 -554
- package/themes/mycom/index.pcss +290 -548
- package/themes/mycom/index.scss +445 -1519
- package/themes/mycom/index.styl +290 -554
- package/themes/octavius/cssVars/declarations/index.css +511 -214
- package/themes/octavius/cssVars/declarations/noSizes.css +620 -0
- package/themes/octavius/cssVars/declarations/onlyColors.css +441 -174
- package/themes/octavius/cssVars/declarations/onlyColors.js +2 -2
- package/themes/octavius/cssVars/declarations/onlyMedia.css +25 -15
- package/themes/octavius/cssVars/declarations/onlyVariables.css +484 -187
- package/themes/octavius/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/octavius/cssVars/theme/fallbacks/index.css +488 -201
- package/themes/octavius/cssVars/theme/fallbacks/index.less +486 -194
- package/themes/octavius/cssVars/theme/fallbacks/index.pcss +486 -194
- package/themes/octavius/cssVars/theme/fallbacks/index.scss +487 -207
- package/themes/octavius/cssVars/theme/fallbacks/index.styl +486 -194
- package/themes/octavius/cssVars/theme/index.js +2172 -752
- package/themes/octavius/cssVars/theme/index.json +2172 -752
- package/themes/octavius/index.css +485 -198
- package/themes/octavius/index.js +711 -219
- package/themes/octavius/index.json +711 -219
- package/themes/octavius/index.less +483 -191
- package/themes/octavius/index.pcss +483 -191
- package/themes/octavius/index.scss +483 -203
- package/themes/octavius/index.styl +483 -191
- package/themes/octaviusCompact/cssVars/declarations/index.css +502 -210
- package/themes/octaviusCompact/cssVars/declarations/noSizes.css +620 -0
- package/themes/octaviusCompact/cssVars/declarations/onlyColors.css +441 -174
- package/themes/octaviusCompact/cssVars/declarations/onlyColors.js +2 -2
- package/themes/octaviusCompact/cssVars/declarations/onlyMedia.css +20 -14
- package/themes/octaviusCompact/cssVars/declarations/onlyVariables.css +479 -183
- package/themes/octaviusCompact/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/octaviusCompact/cssVars/theme/fallbacks/index.css +481 -195
- package/themes/octaviusCompact/cssVars/theme/fallbacks/index.less +481 -190
- package/themes/octaviusCompact/cssVars/theme/fallbacks/index.pcss +481 -190
- package/themes/octaviusCompact/cssVars/theme/fallbacks/index.scss +481 -202
- package/themes/octaviusCompact/cssVars/theme/fallbacks/index.styl +481 -190
- package/themes/octaviusCompact/cssVars/theme/index.js +2165 -749
- package/themes/octaviusCompact/cssVars/theme/index.json +2165 -749
- package/themes/octaviusCompact/index.css +479 -193
- package/themes/octaviusCompact/index.js +710 -219
- package/themes/octaviusCompact/index.json +710 -219
- package/themes/octaviusCompact/index.less +479 -188
- package/themes/octaviusCompact/index.pcss +479 -188
- package/themes/octaviusCompact/index.scss +479 -200
- package/themes/octaviusCompact/index.styl +479 -188
- package/themes/octaviusCompactDark/cssVars/declarations/index.css +514 -222
- package/themes/octaviusCompactDark/cssVars/declarations/noSizes.css +620 -0
- package/themes/octaviusCompactDark/cssVars/declarations/onlyColors.css +453 -186
- package/themes/octaviusCompactDark/cssVars/declarations/onlyColors.js +2 -2
- package/themes/octaviusCompactDark/cssVars/declarations/onlyMedia.css +20 -14
- package/themes/octaviusCompactDark/cssVars/declarations/onlyVariables.css +491 -195
- package/themes/octaviusCompactDark/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/octaviusCompactDark/cssVars/theme/fallbacks/index.css +493 -207
- package/themes/octaviusCompactDark/cssVars/theme/fallbacks/index.less +493 -202
- package/themes/octaviusCompactDark/cssVars/theme/fallbacks/index.pcss +493 -202
- package/themes/octaviusCompactDark/cssVars/theme/fallbacks/index.scss +493 -214
- package/themes/octaviusCompactDark/cssVars/theme/fallbacks/index.styl +493 -202
- package/themes/octaviusCompactDark/cssVars/theme/index.js +2169 -753
- package/themes/octaviusCompactDark/cssVars/theme/index.json +2169 -753
- package/themes/octaviusCompactDark/index.css +491 -205
- package/themes/octaviusCompactDark/index.js +738 -247
- package/themes/octaviusCompactDark/index.json +738 -247
- package/themes/octaviusCompactDark/index.less +491 -200
- package/themes/octaviusCompactDark/index.pcss +491 -200
- package/themes/octaviusCompactDark/index.scss +491 -212
- package/themes/octaviusCompactDark/index.styl +491 -200
- package/themes/octaviusDark/cssVars/declarations/index.css +527 -230
- package/themes/octaviusDark/cssVars/declarations/noSizes.css +620 -0
- package/themes/octaviusDark/cssVars/declarations/onlyColors.css +453 -186
- package/themes/octaviusDark/cssVars/declarations/onlyColors.js +2 -2
- package/themes/octaviusDark/cssVars/declarations/onlyMedia.css +25 -15
- package/themes/octaviusDark/cssVars/declarations/onlyVariables.css +500 -203
- package/themes/octaviusDark/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/octaviusDark/cssVars/theme/fallbacks/index.css +504 -217
- package/themes/octaviusDark/cssVars/theme/fallbacks/index.less +502 -210
- package/themes/octaviusDark/cssVars/theme/fallbacks/index.pcss +502 -210
- package/themes/octaviusDark/cssVars/theme/fallbacks/index.scss +503 -223
- package/themes/octaviusDark/cssVars/theme/fallbacks/index.styl +502 -210
- package/themes/octaviusDark/cssVars/theme/index.js +2181 -761
- package/themes/octaviusDark/cssVars/theme/index.json +2181 -761
- package/themes/octaviusDark/index.css +501 -214
- package/themes/octaviusDark/index.js +746 -254
- package/themes/octaviusDark/index.json +746 -254
- package/themes/octaviusDark/index.less +499 -207
- package/themes/octaviusDark/index.pcss +499 -207
- package/themes/octaviusDark/index.scss +499 -219
- package/themes/octaviusDark/index.styl +499 -207
- package/themes/octaviusVK/cssVars/declarations/index.css +1509 -0
- package/themes/octaviusVK/cssVars/declarations/noSizes.css +620 -0
- package/themes/octaviusVK/cssVars/declarations/onlyAdaptiveGroups.css +123 -0
- package/themes/octaviusVK/cssVars/declarations/onlyColors.css +587 -0
- package/themes/octaviusVK/cssVars/declarations/onlyColors.d.ts +3 -0
- package/themes/octaviusVK/cssVars/declarations/onlyColors.js +11 -0
- package/themes/octaviusVK/cssVars/declarations/onlyMedia.css +284 -0
- package/themes/octaviusVK/cssVars/declarations/onlyVariables.css +852 -0
- package/themes/octaviusVK/cssVars/declarations/onlyVariables.d.ts +3 -0
- package/themes/octaviusVK/cssVars/declarations/onlyVariables.js +11 -0
- package/themes/octaviusVK/cssVars/theme/fallbacks/index.css +1101 -0
- package/themes/octaviusVK/cssVars/theme/fallbacks/index.less +913 -0
- package/themes/octaviusVK/cssVars/theme/fallbacks/index.pcss +906 -0
- package/themes/octaviusVK/cssVars/theme/fallbacks/index.scss +1078 -0
- package/themes/octaviusVK/cssVars/theme/fallbacks/index.styl +913 -0
- package/themes/octaviusVK/cssVars/theme/index.d.ts +4 -0
- package/themes/octaviusVK/cssVars/theme/index.js +4844 -0
- package/themes/octaviusVK/cssVars/theme/index.json +4841 -0
- package/themes/octaviusVK/index.css +1101 -0
- package/themes/octaviusVK/index.d.ts +4 -0
- package/themes/octaviusVK/index.js +1520 -0
- package/themes/octaviusVK/index.json +1517 -0
- package/themes/octaviusVK/index.less +913 -0
- package/themes/octaviusVK/index.pcss +906 -0
- package/themes/octaviusVK/index.scss +1078 -0
- package/themes/octaviusVK/index.styl +913 -0
- package/themes/octaviusVKDark/cssVars/declarations/index.css +1509 -0
- package/themes/octaviusVKDark/cssVars/declarations/noSizes.css +620 -0
- package/themes/octaviusVKDark/cssVars/declarations/onlyAdaptiveGroups.css +123 -0
- package/themes/octaviusVKDark/cssVars/declarations/onlyColors.css +587 -0
- package/themes/octaviusVKDark/cssVars/declarations/onlyColors.d.ts +3 -0
- package/themes/octaviusVKDark/cssVars/declarations/onlyColors.js +11 -0
- package/themes/octaviusVKDark/cssVars/declarations/onlyMedia.css +284 -0
- package/themes/octaviusVKDark/cssVars/declarations/onlyVariables.css +852 -0
- package/themes/octaviusVKDark/cssVars/declarations/onlyVariables.d.ts +3 -0
- package/themes/octaviusVKDark/cssVars/declarations/onlyVariables.js +11 -0
- package/themes/octaviusVKDark/cssVars/theme/fallbacks/index.css +1101 -0
- package/themes/octaviusVKDark/cssVars/theme/fallbacks/index.less +913 -0
- package/themes/octaviusVKDark/cssVars/theme/fallbacks/index.pcss +906 -0
- package/themes/octaviusVKDark/cssVars/theme/fallbacks/index.scss +1078 -0
- package/themes/octaviusVKDark/cssVars/theme/fallbacks/index.styl +913 -0
- package/themes/octaviusVKDark/cssVars/theme/index.d.ts +4 -0
- package/themes/octaviusVKDark/cssVars/theme/index.js +4844 -0
- package/themes/octaviusVKDark/cssVars/theme/index.json +4841 -0
- package/themes/octaviusVKDark/index.css +1101 -0
- package/themes/octaviusVKDark/index.d.ts +4 -0
- package/themes/octaviusVKDark/index.js +1520 -0
- package/themes/octaviusVKDark/index.json +1517 -0
- package/themes/octaviusVKDark/index.less +913 -0
- package/themes/octaviusVKDark/index.pcss +906 -0
- package/themes/octaviusVKDark/index.scss +1078 -0
- package/themes/octaviusVKDark/index.styl +913 -0
- package/themes/octaviusWhite/cssVars/declarations/index.css +1438 -0
- package/themes/octaviusWhite/cssVars/declarations/noSizes.css +620 -0
- package/themes/octaviusWhite/cssVars/declarations/onlyAdaptiveGroups.css +110 -0
- package/themes/octaviusWhite/cssVars/declarations/onlyColors.css +587 -0
- package/themes/octaviusWhite/cssVars/declarations/onlyColors.d.ts +3 -0
- package/themes/octaviusWhite/cssVars/declarations/onlyColors.js +11 -0
- package/themes/octaviusWhite/cssVars/declarations/onlyMedia.css +271 -0
- package/themes/octaviusWhite/cssVars/declarations/onlyVariables.css +839 -0
- package/themes/octaviusWhite/cssVars/declarations/onlyVariables.d.ts +3 -0
- package/themes/octaviusWhite/cssVars/declarations/onlyVariables.js +11 -0
- package/themes/octaviusWhite/cssVars/theme/fallbacks/index.css +1056 -0
- package/themes/octaviusWhite/cssVars/theme/fallbacks/index.less +897 -0
- package/themes/octaviusWhite/cssVars/theme/fallbacks/index.pcss +890 -0
- package/themes/octaviusWhite/cssVars/theme/fallbacks/index.scss +1043 -0
- package/themes/octaviusWhite/cssVars/theme/fallbacks/index.styl +897 -0
- package/themes/octaviusWhite/cssVars/theme/index.d.ts +4 -0
- package/themes/octaviusWhite/cssVars/theme/index.js +4740 -0
- package/themes/octaviusWhite/cssVars/theme/index.json +4737 -0
- package/themes/octaviusWhite/index.css +1056 -0
- package/themes/octaviusWhite/index.d.ts +4 -0
- package/themes/octaviusWhite/index.js +1507 -0
- package/themes/octaviusWhite/index.json +1504 -0
- package/themes/octaviusWhite/index.less +897 -0
- package/themes/octaviusWhite/index.pcss +890 -0
- package/themes/octaviusWhite/index.scss +1043 -0
- package/themes/octaviusWhite/index.styl +897 -0
- package/themes/otvet/cssVars/declarations/index.css +182 -244
- package/themes/otvet/cssVars/declarations/noSizes.css +268 -0
- package/themes/otvet/cssVars/declarations/onlyColors.css +156 -228
- package/themes/otvet/cssVars/declarations/onlyColors.js +2 -2
- package/themes/otvet/cssVars/declarations/onlyMedia.css +9 -5
- package/themes/otvet/cssVars/declarations/onlyVariables.css +171 -237
- package/themes/otvet/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/otvet/cssVars/theme/fallbacks/index.css +175 -241
- package/themes/otvet/cssVars/theme/fallbacks/index.less +173 -239
- package/themes/otvet/cssVars/theme/fallbacks/index.pcss +173 -239
- package/themes/otvet/cssVars/theme/fallbacks/index.scss +174 -240
- package/themes/otvet/cssVars/theme/fallbacks/index.styl +173 -239
- package/themes/otvet/cssVars/theme/index.js +597 -889
- package/themes/otvet/cssVars/theme/index.json +597 -889
- package/themes/otvet/index.css +173 -239
- package/themes/otvet/index.js +226 -333
- package/themes/otvet/index.json +226 -333
- package/themes/otvet/index.less +171 -237
- package/themes/otvet/index.pcss +171 -237
- package/themes/otvet/index.scss +172 -238
- package/themes/otvet/index.styl +171 -237
- package/themes/otvetDark/cssVars/declarations/index.css +194 -256
- package/themes/otvetDark/cssVars/declarations/noSizes.css +268 -0
- package/themes/otvetDark/cssVars/declarations/onlyColors.css +168 -240
- package/themes/otvetDark/cssVars/declarations/onlyColors.js +2 -2
- package/themes/otvetDark/cssVars/declarations/onlyMedia.css +9 -5
- package/themes/otvetDark/cssVars/declarations/onlyVariables.css +183 -249
- package/themes/otvetDark/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/otvetDark/cssVars/theme/fallbacks/index.css +187 -253
- package/themes/otvetDark/cssVars/theme/fallbacks/index.less +185 -251
- package/themes/otvetDark/cssVars/theme/fallbacks/index.pcss +185 -251
- package/themes/otvetDark/cssVars/theme/fallbacks/index.scss +186 -252
- package/themes/otvetDark/cssVars/theme/fallbacks/index.styl +185 -251
- package/themes/otvetDark/cssVars/theme/index.js +603 -895
- package/themes/otvetDark/cssVars/theme/index.json +603 -895
- package/themes/otvetDark/index.css +185 -251
- package/themes/otvetDark/index.js +256 -363
- package/themes/otvetDark/index.json +256 -363
- package/themes/otvetDark/index.less +183 -249
- package/themes/otvetDark/index.pcss +183 -249
- package/themes/otvetDark/index.scss +184 -250
- package/themes/otvetDark/index.styl +183 -249
- package/themes/paradigmBase/cssVars/declarations/index.css +626 -159
- package/themes/paradigmBase/cssVars/declarations/noSizes.css +268 -0
- package/themes/paradigmBase/cssVars/declarations/onlyAdaptiveGroups.css +18 -0
- package/themes/paradigmBase/cssVars/declarations/onlyColors.css +159 -129
- package/themes/paradigmBase/cssVars/declarations/onlyColors.js +2 -2
- package/themes/paradigmBase/cssVars/declarations/onlyMedia.css +265 -0
- package/themes/paradigmBase/cssVars/declarations/onlyVariables.css +281 -146
- package/themes/paradigmBase/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/paradigmBase/cssVars/theme/fallbacks/index.css +345 -160
- package/themes/paradigmBase/cssVars/theme/fallbacks/index.less +313 -153
- package/themes/paradigmBase/cssVars/theme/fallbacks/index.pcss +306 -154
- package/themes/paradigmBase/cssVars/theme/fallbacks/index.scss +369 -167
- package/themes/paradigmBase/cssVars/theme/fallbacks/index.styl +313 -153
- package/themes/paradigmBase/cssVars/theme/index.js +1501 -525
- package/themes/paradigmBase/cssVars/theme/index.json +1501 -525
- package/themes/paradigmBase/index.css +342 -157
- package/themes/paradigmBase/index.js +476 -184
- package/themes/paradigmBase/index.json +476 -184
- package/themes/paradigmBase/index.less +310 -150
- package/themes/paradigmBase/index.pcss +303 -151
- package/themes/paradigmBase/index.scss +365 -163
- package/themes/paradigmBase/index.styl +310 -150
- package/themes/paradigmBaseDark/cssVars/declarations/index.css +642 -175
- package/themes/paradigmBaseDark/cssVars/declarations/noSizes.css +268 -0
- package/themes/paradigmBaseDark/cssVars/declarations/onlyAdaptiveGroups.css +18 -0
- package/themes/paradigmBaseDark/cssVars/declarations/onlyColors.css +171 -141
- package/themes/paradigmBaseDark/cssVars/declarations/onlyColors.js +2 -2
- package/themes/paradigmBaseDark/cssVars/declarations/onlyMedia.css +265 -0
- package/themes/paradigmBaseDark/cssVars/declarations/onlyVariables.css +297 -162
- package/themes/paradigmBaseDark/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/paradigmBaseDark/cssVars/theme/fallbacks/index.css +361 -176
- package/themes/paradigmBaseDark/cssVars/theme/fallbacks/index.less +329 -169
- package/themes/paradigmBaseDark/cssVars/theme/fallbacks/index.pcss +322 -170
- package/themes/paradigmBaseDark/cssVars/theme/fallbacks/index.scss +385 -183
- package/themes/paradigmBaseDark/cssVars/theme/fallbacks/index.styl +329 -169
- package/themes/paradigmBaseDark/cssVars/theme/index.js +1517 -541
- package/themes/paradigmBaseDark/cssVars/theme/index.json +1517 -541
- package/themes/paradigmBaseDark/index.css +358 -173
- package/themes/paradigmBaseDark/index.js +509 -217
- package/themes/paradigmBaseDark/index.json +509 -217
- package/themes/paradigmBaseDark/index.less +326 -166
- package/themes/paradigmBaseDark/index.pcss +319 -167
- package/themes/paradigmBaseDark/index.scss +381 -179
- package/themes/paradigmBaseDark/index.styl +326 -166
- package/themes/pharma/cssVars/declarations/index.css +801 -2025
- package/themes/pharma/cssVars/declarations/noSizes.css +368 -0
- package/themes/pharma/cssVars/declarations/onlyAdaptiveGroups.css +89 -59
- package/themes/pharma/cssVars/declarations/onlyColors.css +177 -228
- package/themes/pharma/cssVars/declarations/onlyColors.js +2 -2
- package/themes/pharma/cssVars/declarations/onlyMedia.css +176 -882
- package/themes/pharma/cssVars/declarations/onlyVariables.css +310 -514
- package/themes/pharma/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/pharma/cssVars/theme/fallbacks/index.css +547 -1095
- package/themes/pharma/cssVars/theme/fallbacks/index.less +342 -599
- package/themes/pharma/cssVars/theme/fallbacks/index.pcss +342 -593
- package/themes/pharma/cssVars/theme/fallbacks/index.scss +490 -1557
- package/themes/pharma/cssVars/theme/fallbacks/index.styl +342 -599
- package/themes/pharma/cssVars/theme/index.js +1161 -1963
- package/themes/pharma/cssVars/theme/index.json +1161 -1963
- package/themes/pharma/index.css +528 -1076
- package/themes/pharma/index.js +446 -724
- package/themes/pharma/index.json +446 -724
- package/themes/pharma/index.less +324 -581
- package/themes/pharma/index.pcss +324 -575
- package/themes/pharma/index.scss +504 -1571
- package/themes/pharma/index.styl +324 -581
- package/themes/promo/cssVars/declarations/index.css +176 -238
- package/themes/promo/cssVars/declarations/noSizes.css +268 -0
- package/themes/promo/cssVars/declarations/onlyColors.css +156 -228
- package/themes/promo/cssVars/declarations/onlyColors.js +2 -2
- package/themes/promo/cssVars/declarations/onlyMedia.css +6 -2
- package/themes/promo/cssVars/declarations/onlyVariables.css +170 -236
- package/themes/promo/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/promo/cssVars/theme/fallbacks/index.css +172 -238
- package/themes/promo/cssVars/theme/fallbacks/index.less +172 -238
- package/themes/promo/cssVars/theme/fallbacks/index.pcss +172 -238
- package/themes/promo/cssVars/theme/fallbacks/index.scss +172 -238
- package/themes/promo/cssVars/theme/fallbacks/index.styl +172 -238
- package/themes/promo/cssVars/theme/index.js +596 -888
- package/themes/promo/cssVars/theme/index.json +596 -888
- package/themes/promo/index.css +170 -236
- package/themes/promo/index.js +223 -330
- package/themes/promo/index.json +223 -330
- package/themes/promo/index.less +170 -236
- package/themes/promo/index.pcss +170 -236
- package/themes/promo/index.scss +170 -236
- package/themes/promo/index.styl +170 -236
- package/themes/todo/cssVars/declarations/index.css +196 -268
- package/themes/todo/cssVars/declarations/noSizes.css +268 -0
- package/themes/todo/cssVars/declarations/onlyColors.css +156 -228
- package/themes/todo/cssVars/declarations/onlyColors.js +2 -2
- package/themes/todo/cssVars/declarations/onlyMedia.css +19 -15
- package/themes/todo/cssVars/declarations/onlyVariables.css +175 -241
- package/themes/todo/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/todo/cssVars/theme/fallbacks/index.css +179 -255
- package/themes/todo/cssVars/theme/fallbacks/index.less +177 -248
- package/themes/todo/cssVars/theme/fallbacks/index.pcss +177 -248
- package/themes/todo/cssVars/theme/fallbacks/index.scss +178 -261
- package/themes/todo/cssVars/theme/fallbacks/index.styl +177 -248
- package/themes/todo/cssVars/theme/index.js +604 -898
- package/themes/todo/cssVars/theme/index.json +604 -898
- package/themes/todo/index.css +176 -252
- package/themes/todo/index.js +230 -339
- package/themes/todo/index.json +230 -339
- package/themes/todo/index.less +174 -245
- package/themes/todo/index.pcss +174 -245
- package/themes/todo/index.scss +174 -257
- package/themes/todo/index.styl +174 -245
- package/themes/vkBase/cssVars/declarations/index.css +154 -94
- package/themes/vkBase/cssVars/declarations/noSizes.css +248 -0
- package/themes/vkBase/cssVars/declarations/onlyAdaptiveGroups.css +14 -5
- package/themes/vkBase/cssVars/declarations/onlyColors.css +75 -57
- package/themes/vkBase/cssVars/declarations/onlyColors.js +2 -2
- package/themes/vkBase/cssVars/declarations/onlyVariables.css +104 -72
- package/themes/vkBase/cssVars/declarations/onlyVariables.js +2 -2
- package/themes/vkBase/cssVars/theme/fallbacks/index.css +142 -90
- package/themes/vkBase/cssVars/theme/fallbacks/index.less +106 -74
- package/themes/vkBase/cssVars/theme/fallbacks/index.pcss +106 -74
- package/themes/vkBase/cssVars/theme/fallbacks/index.scss +125 -82
- package/themes/vkBase/cssVars/theme/fallbacks/index.styl +106 -74
- package/themes/vkBase/cssVars/theme/index.js +393 -209
- package/themes/vkBase/cssVars/theme/index.json +393 -209
- package/themes/vkBase/index.css +140 -88
- package/themes/vkBase/index.js +121 -74
- package/themes/vkBase/index.json +121 -74
- package/themes/vkBase/index.less +104 -72
- package/themes/vkBase/index.pcss +104 -72
- package/themes/vkBase/index.scss +123 -80
- package/themes/vkBase/index.styl +104 -72
- package/themes/vkBaseDark/cssVars/declarations/index.css +667 -0
- package/themes/vkBaseDark/cssVars/declarations/noSizes.css +248 -0
- package/themes/vkBaseDark/cssVars/declarations/onlyAdaptiveGroups.css +102 -0
- package/themes/vkBaseDark/cssVars/declarations/onlyColors.css +236 -0
- package/themes/vkBaseDark/cssVars/declarations/onlyColors.d.ts +3 -0
- package/themes/vkBaseDark/cssVars/declarations/onlyColors.js +11 -0
- package/themes/vkBaseDark/cssVars/declarations/onlyVariables.css +375 -0
- package/themes/vkBaseDark/cssVars/declarations/onlyVariables.d.ts +3 -0
- package/themes/vkBaseDark/cssVars/declarations/onlyVariables.js +11 -0
- package/themes/vkBaseDark/cssVars/theme/fallbacks/index.css +564 -0
- package/themes/vkBaseDark/cssVars/theme/fallbacks/index.less +407 -0
- package/themes/vkBaseDark/cssVars/theme/fallbacks/index.pcss +408 -0
- package/themes/vkBaseDark/cssVars/theme/fallbacks/index.scss +523 -0
- package/themes/vkBaseDark/cssVars/theme/fallbacks/index.styl +407 -0
- package/themes/vkBaseDark/cssVars/theme/index.d.ts +4 -0
- package/themes/vkBaseDark/cssVars/theme/index.js +2246 -0
- package/themes/vkBaseDark/cssVars/theme/index.json +2243 -0
- package/themes/vkBaseDark/index.css +564 -0
- package/themes/vkBaseDark/index.d.ts +4 -0
- package/themes/vkBaseDark/index.js +663 -0
- package/themes/vkBaseDark/index.json +660 -0
- package/themes/vkBaseDark/index.less +407 -0
- package/themes/vkBaseDark/index.pcss +408 -0
- package/themes/vkBaseDark/index.scss +523 -0
- package/themes/vkBaseDark/index.styl +407 -0
- package/themes/vkCom/cssVars/declarations/index.css +667 -0
- package/themes/vkCom/cssVars/declarations/noSizes.css +248 -0
- package/themes/vkCom/cssVars/declarations/onlyAdaptiveGroups.css +102 -0
- package/themes/vkCom/cssVars/declarations/onlyColors.css +236 -0
- package/themes/vkCom/cssVars/declarations/onlyColors.d.ts +3 -0
- package/themes/vkCom/cssVars/declarations/onlyColors.js +11 -0
- package/themes/vkCom/cssVars/declarations/onlyVariables.css +375 -0
- package/themes/vkCom/cssVars/declarations/onlyVariables.d.ts +3 -0
- package/themes/vkCom/cssVars/declarations/onlyVariables.js +11 -0
- package/themes/vkCom/cssVars/theme/fallbacks/index.css +564 -0
- package/themes/vkCom/cssVars/theme/fallbacks/index.less +407 -0
- package/themes/vkCom/cssVars/theme/fallbacks/index.pcss +408 -0
- package/themes/vkCom/cssVars/theme/fallbacks/index.scss +523 -0
- package/themes/vkCom/cssVars/theme/fallbacks/index.styl +407 -0
- package/themes/vkCom/cssVars/theme/index.d.ts +4 -0
- package/themes/vkCom/cssVars/theme/index.js +2246 -0
- package/themes/vkCom/cssVars/theme/index.json +2243 -0
- package/themes/vkCom/index.css +564 -0
- package/themes/vkCom/index.d.ts +4 -0
- package/themes/vkCom/index.js +663 -0
- package/themes/vkCom/index.json +660 -0
- package/themes/vkCom/index.less +407 -0
- package/themes/vkCom/index.pcss +408 -0
- package/themes/vkCom/index.scss +523 -0
- package/themes/vkCom/index.styl +407 -0
- package/themes/vkIOS/cssVars/declarations/index.css +667 -0
- package/themes/vkIOS/cssVars/declarations/noSizes.css +248 -0
- package/themes/vkIOS/cssVars/declarations/onlyAdaptiveGroups.css +102 -0
- package/themes/vkIOS/cssVars/declarations/onlyColors.css +236 -0
- package/themes/vkIOS/cssVars/declarations/onlyColors.d.ts +3 -0
- package/themes/vkIOS/cssVars/declarations/onlyColors.js +11 -0
- package/themes/vkIOS/cssVars/declarations/onlyVariables.css +375 -0
- package/themes/vkIOS/cssVars/declarations/onlyVariables.d.ts +3 -0
- package/themes/vkIOS/cssVars/declarations/onlyVariables.js +11 -0
- package/themes/vkIOS/cssVars/theme/fallbacks/index.css +564 -0
- package/themes/vkIOS/cssVars/theme/fallbacks/index.less +407 -0
- package/themes/vkIOS/cssVars/theme/fallbacks/index.pcss +408 -0
- package/themes/vkIOS/cssVars/theme/fallbacks/index.scss +523 -0
- package/themes/vkIOS/cssVars/theme/fallbacks/index.styl +407 -0
- package/themes/vkIOS/cssVars/theme/index.d.ts +4 -0
- package/themes/vkIOS/cssVars/theme/index.js +2246 -0
- package/themes/vkIOS/cssVars/theme/index.json +2243 -0
- package/themes/vkIOS/index.css +564 -0
- package/themes/vkIOS/index.d.ts +4 -0
- package/themes/vkIOS/index.js +663 -0
- package/themes/vkIOS/index.json +660 -0
- package/themes/vkIOS/index.less +407 -0
- package/themes/vkIOS/index.pcss +408 -0
- package/themes/vkIOS/index.scss +523 -0
- package/themes/vkIOS/index.styl +407 -0
- package/utils/common/colors/socialColors.d.ts +11 -0
- package/utils/common/colors/socialColors.js +12 -0
- package/utils/common/index.d.ts +2 -1
- package/utils/common/index.js +3 -1
- package/CHANGELOG.md +0 -139
package/README.md
CHANGED
|
@@ -1,42 +1,86 @@
|
|
|
1
1
|
<img src="assets/vkui_logo.png" alt="vkui logo" height="52"/>
|
|
2
2
|
<img src="assets/logo.svg" alt="vkui logo" height="52"/>
|
|
3
3
|
|
|
4
|
+
[](https://github.com/VKCOM/vkui-tokens/actions/workflows/test.yml)
|
|
5
|
+
[](https://www.npmjs.com/package/@vkontakte/vkui-tokens)
|
|
6
|
+
[](https://github.com/VKCOM/vkui-tokens)
|
|
7
|
+
|
|
8
|
+
Этот репозиторий содержит токены единой дизайн-системы VKUI и
|
|
9
|
+
их значения для тем оформления различных проектов.
|
|
10
|
+
|
|
11
|
+
Темы собираются в следующие форматы: `css`, `scss`, `less`, `pcss`, `styl`, `js`, `json`.
|
|
12
|
+
|
|
13
|
+
Для описания интерфейсов тем и значений переменных используется TypeScript.
|
|
14
|
+
|
|
15
|
+
# Содержание
|
|
16
|
+
|
|
17
|
+
* [Использование](#использование)
|
|
18
|
+
* [Использование CSS-переменных темы напрямую из пакета](#использование-css-переменных-темы-напрямую-из-пакета)
|
|
19
|
+
* [Подключение темы на страницу](#подключение-темы-на-страницу)
|
|
20
|
+
* [Использование переменных в вёрстке](#использование-переменных-в-вёрстке)
|
|
21
|
+
* [Использование базовой темы напрямую из пакета](#использование-базовой-темы-напрямую-из-пакета)
|
|
22
|
+
* [Инструменты](#инструменты)
|
|
23
|
+
* [Локальная сборка своих тем инструментами библиотеки](#локальная-сборка-своих-тем-инструментами-библиотеки)
|
|
24
|
+
* [Наследование от существующей темы](#наследование-от-существующей-темы)
|
|
25
|
+
* [Создание собственной темы "с нуля"](#создание-собственной-темы-с-нуля)
|
|
26
|
+
* [Roadmap](#roadmap)
|
|
27
|
+
* [Полезные ссылки](#полезные-ссылки)
|
|
28
|
+
* [Информация для внесения изменений](CONTRIBUTING.md)
|
|
29
|
+
* [Changelog (архивная версия)](CHANGELOG.OLD.md)
|
|
30
|
+
|
|
31
|
+
Актуальный changelog находится на странице
|
|
32
|
+
[релизов в GitHub](https://github.com/VKCOM/vkui-tokens/releases)!
|
|
33
|
+
|
|
4
34
|
# Использование
|
|
5
35
|
|
|
6
|
-
|
|
36
|
+
Устанавливаем npm-пакет `@vkontakte/vkui-tokens`:
|
|
7
37
|
```bash
|
|
8
38
|
npm i --save @vkontakte/vkui-tokens@latest
|
|
9
39
|
```
|
|
10
|
-
##
|
|
11
|
-
|
|
40
|
+
## Использование CSS-переменных темы напрямую из пакета
|
|
41
|
+
### Подключение темы на страницу
|
|
42
|
+
|
|
43
|
+
В любом CSS-файле подключаем файл темы со значениями переменных:
|
|
12
44
|
```css
|
|
13
45
|
@import "@vkontakte/vkui-tokens/themes/vkBase/cssVars/declarations/index.css";
|
|
14
46
|
```
|
|
15
47
|
|
|
16
|
-
|
|
17
|
-
|
|
48
|
+
### Использование переменных в вёрстке
|
|
49
|
+
#### Использование в CSS
|
|
18
50
|
```postcss
|
|
19
51
|
.myAwesomeClass:hover {
|
|
20
52
|
background-color: var(--vkui--color_background--hover);
|
|
21
53
|
}
|
|
22
54
|
```
|
|
23
|
-
|
|
55
|
+
|
|
56
|
+
#### Использование CSS-переменных через объект в JavaScript (TypeScript)
|
|
24
57
|
```typescript
|
|
25
58
|
import baseTheme from '@vkontakte/vkui-tokens/themes/vkBase/cssVars/theme';
|
|
26
59
|
|
|
60
|
+
// Собствено имя CSS-переменной (название токена)
|
|
27
61
|
console.log(baseTheme.colorBackground.hover.name) // --vkui--color_background--hover;
|
|
62
|
+
// Сниппет для использования CSS-переменной
|
|
28
63
|
console.log(baseTheme.colorBackground.hover.value) // var(--vkui--color_background--hover, #F5F5F7)
|
|
29
64
|
|
|
30
|
-
//
|
|
31
|
-
//
|
|
65
|
+
// Динамически (с учётом возможных переопределений)
|
|
66
|
+
// узнаём, чему равно значение переменной внутри myElement:
|
|
32
67
|
getComputedStyle(myElement).getPropertyValue(baseTheme.colorBackground.hover.name)
|
|
33
68
|
```
|
|
34
|
-
* для того, чтобы принудительно включать тот или иной вид темы у конкретного поддерева элементов, пользуемся классами `.vkui--force-${auto | regular | compact | large | largeX ...}`. Смотри [демо](demo/example-adaptive-css-vars-theme.html) работы адаптивных переменных и спец. классов. (Также можно просто использовать переменную конкретного брейкпоинта (ex. --vkui--size_field_height--**_compact_**), они все также попадают в `:root`)
|
|
35
69
|
|
|
70
|
+
#### Принудительное использование токенов определённого размера
|
|
71
|
+
Чтобы принудительно включить тот или иной вид темы у конкретного
|
|
72
|
+
поддерева элементов, нужно воспользоваться классами
|
|
73
|
+
`.vkui--force-${auto | regular | compact | large | largeX ...}`.
|
|
74
|
+
Смотри [демо](demo/example-adaptive-css-vars-theme.html) работы
|
|
75
|
+
адаптивных переменных и спец. классов.
|
|
36
76
|
|
|
37
|
-
|
|
77
|
+
Также можно просто использовать переменную конкретного брейкпоинта
|
|
78
|
+
(ex. --vkui--size_field_height--**_compact_**), они все тоже
|
|
79
|
+
попадают в `:root`)
|
|
80
|
+
|
|
81
|
+
## Использование базовой темы напрямую из пакета
|
|
38
82
|
### js/ts/json
|
|
39
|
-
|
|
83
|
+
Импортируем необходимую тему в файле и используем:
|
|
40
84
|
```ts
|
|
41
85
|
import baseTheme from '@vkontakte/vkui-tokens/themes/vkBase';
|
|
42
86
|
|
|
@@ -44,7 +88,7 @@ import baseTheme from '@vkontakte/vkui-tokens/themes/vkBase';
|
|
|
44
88
|
```
|
|
45
89
|
|
|
46
90
|
### Используем в scss/styl/less root темы из пакета
|
|
47
|
-
|
|
91
|
+
Импортируем файл с необходимой темой и используем переменные от туда (снизу синтаксис SCSS)
|
|
48
92
|
```scss
|
|
49
93
|
@import "~@vkontakte/vkui-tokens/themes/vkBase/index";
|
|
50
94
|
|
|
@@ -57,18 +101,17 @@ import baseTheme from '@vkontakte/vkui-tokens/themes/vkBase';
|
|
|
57
101
|
}
|
|
58
102
|
```
|
|
59
103
|
|
|
60
|
-
|
|
61
104
|
### Используем pcss формат темы из пакета
|
|
62
105
|
|
|
63
|
-
|
|
106
|
+
1Заходим в файл, где хотим использовать тему, и импортируем её:
|
|
64
107
|
|
|
65
108
|
@import "@vkontakte/vkui-tokens/themes/vkBase";
|
|
66
109
|
|
|
67
|
-
|
|
110
|
+
2. Заходим в файл темы, смотрим какие там есть переменные и юзаем их, например:
|
|
68
111
|
|
|
69
112
|
width: var(--size-content-block-width);
|
|
70
113
|
|
|
71
|
-
|
|
114
|
+
3. Просто так ничего не заработает, нужно поставить postcss:
|
|
72
115
|
|
|
73
116
|
npm i --save-dev postcss
|
|
74
117
|
|
|
@@ -76,35 +119,35 @@ import baseTheme from '@vkontakte/vkui-tokens/themes/vkBase';
|
|
|
76
119
|
|
|
77
120
|
npm i --save-dev postcss-cli
|
|
78
121
|
|
|
79
|
-
|
|
122
|
+
4. Создаем конфиг postcss. Для этого создаем файл postcss.config.js (можно в любом месте проекта, но лучше в корне) и пишем в него необходимые плагины:
|
|
80
123
|
|
|
81
124
|
```javascript
|
|
82
125
|
const postcssPresetEnv = require('postcss-preset-env');
|
|
83
126
|
|
|
84
127
|
module.exports = {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
128
|
+
plugins: [
|
|
129
|
+
require('postcss-import'),
|
|
130
|
+
require('precss'),
|
|
131
|
+
require('postcss-css-variables'),
|
|
132
|
+
require('postcss-custom-media'),
|
|
133
|
+
require('postcss-media-minmax'),
|
|
134
|
+
require('postcss-extend-rule'),
|
|
135
|
+
postcssPresetEnv({
|
|
136
|
+
stage: 0,
|
|
137
|
+
}),
|
|
138
|
+
require('postcss-color-mix'),
|
|
139
|
+
require('cssnano')
|
|
140
|
+
],
|
|
98
141
|
};
|
|
99
142
|
```
|
|
100
143
|
Возможно, вам не понадобятся все эти плагины, поэтому лучше почитать, что делает каждый из них (https://www.postcss.parts/).
|
|
101
144
|
Нужно посмотреть файл вашей темы и ваш css (scss и др.), чтобы понять, что вам необходимо.
|
|
102
145
|
|
|
103
|
-
|
|
146
|
+
5. Устанавливаем все необходимые плагины, которые написали в конфиге, например:
|
|
104
147
|
|
|
105
148
|
npm i --save-dev postcss-import
|
|
106
149
|
|
|
107
|
-
|
|
150
|
+
6. Настраиваем сборку postcss.
|
|
108
151
|
|
|
109
152
|
Сборка производится командой postcss через командную строку с необходимым параметрами.
|
|
110
153
|
Про них подробнее тут https://github.com/postcss/postcss-cli
|
|
@@ -115,11 +158,21 @@ import baseTheme from '@vkontakte/vkui-tokens/themes/vkBase';
|
|
|
115
158
|
|
|
116
159
|
Такая команда прогонит файл src/main.css с помощью конфига из текущей папки и положит результат в папку public.
|
|
117
160
|
|
|
161
|
+
# Инструменты
|
|
118
162
|
## Локальная сборка своих тем инструментами библиотеки
|
|
119
163
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
164
|
+
Библиотека предоставляет интерфейсы и темы, от которых можно
|
|
165
|
+
наследоваться.
|
|
166
|
+
|
|
167
|
+
Помимо этого, библиотека предоставляет набор функций, которые позволяют
|
|
168
|
+
собрать собственную тему в нужном формате.
|
|
169
|
+
|
|
170
|
+
Сборка темы подразумевает раскрытие наследования, генерацию цветов
|
|
171
|
+
состояний (hover, active), округление и "пикселизация" значений и т.д.
|
|
172
|
+
|
|
173
|
+
### Наследование от существующей темы
|
|
174
|
+
Пример:
|
|
175
|
+
|
|
123
176
|
```typescript
|
|
124
177
|
import type {ThemeDescription} from '@vkontakte/vkui-tokens/interfaces/general';
|
|
125
178
|
import type {Adaptive} from '@vkontakte/vkui-tokens/interfaces/general/tools';
|
|
@@ -147,8 +200,13 @@ const {theme, pixelifyTheme, cssVarsTheme} = expandAll(myNewAwesomeTheme);
|
|
|
147
200
|
const cssString = compileStyles('css', pixelifyTheme);
|
|
148
201
|
```
|
|
149
202
|
|
|
150
|
-
###
|
|
151
|
-
|
|
203
|
+
### Создание собственной темы "с нуля"
|
|
204
|
+
В некоторых случаях нет необходимости наследоваться от одной из
|
|
205
|
+
базовых тем. Библиотека позволяет сгенерировать свою тему из
|
|
206
|
+
произвольного количества уникальных переменных.
|
|
207
|
+
|
|
208
|
+
Пример:
|
|
209
|
+
|
|
152
210
|
```typescript
|
|
153
211
|
import type {Adaptive} from '@vkontakte/vkui-tokens/interfaces/general/tools';
|
|
154
212
|
import {expandAll} from '@vkontakte/vkui-tokens/build/expandTheme';
|
|
@@ -180,11 +238,19 @@ const {theme, pixelifyTheme, cssVarsTheme} = expandAll(myNewAwesomeTheme);
|
|
|
180
238
|
const cssString = compileStyles('css', pixelifyTheme);
|
|
181
239
|
```
|
|
182
240
|
|
|
183
|
-
#
|
|
184
|
-
* [ ]
|
|
241
|
+
# Roadmap
|
|
242
|
+
* [ ] Добавить более умную генерацию active, hover состояний цвета.
|
|
243
|
+
При генерации нужно учитывать тёмный и светлый вариант тем, а также
|
|
244
|
+
сам цвет, для которого генерируется состояние.
|
|
245
|
+
(решаем проблему, что цвет наведения, сгенерированный от синего,
|
|
246
|
+
плохо виден на большинстве мониторов).
|
|
247
|
+
* [ ] Генерация цветов по заранее определённой палитре.
|
|
248
|
+
* [ ] Текстовое описание семантики каждого токена.
|
|
249
|
+
* [ ] Более подробная документация.
|
|
250
|
+
* [ ] Сайт с примерами и описанием.
|
|
185
251
|
|
|
186
252
|
# Полезные ссылки
|
|
187
|
-
1. [Доклад](https://youtu.be/0rHgqQvl0NQ?t=1858) про дизайн-системы на фронтенде: там
|
|
188
|
-
2. Серия видеороликов на youtube, где показано использование этой библиотеки (но со старым названием, не пугайтесь), как ядра
|
|
253
|
+
1. [Доклад](https://youtu.be/0rHgqQvl0NQ?t=1858) про дизайн-системы на фронтенде: там рассказывается, зачем нужны дизайн-токены, причём тут UI-kit и как делать темизацию.
|
|
254
|
+
2. Серия видеороликов на youtube, где показано использование этой библиотеки (но со старым названием, не пугайтесь), как ядра дизайн-системы на практике: [первый](https://www.youtube.com/watch?v=RKCsrPOxYWE), [второй](https://www.youtube.com/watch?v=ZhiH4jFL-kU), [третий](https://www.youtube.com/watch?v=ZXOmmkyxrwk)
|
|
189
255
|
3. Opensource библиотека компонентов (UI-kit) [VKUI](https://github.com/VKCOM/VKUI), которая использует токены.
|
|
190
|
-
4. [Сайт](https://paradigm.mail.ru/)
|
|
256
|
+
4. [Сайт](https://paradigm.mail.ru/) дизайн-система Paradigm, из которой выросла эта библиотека. Там можно найти дизайнерские принципы и идеи, которые стали основой этого репозитория.
|
package/build/compilers/index.js
CHANGED
|
@@ -72,11 +72,13 @@ function writeCssVarsSourceFile(themePath, theme, cssWarsTheme) {
|
|
|
72
72
|
{ mode: 'onlyVariables', fileName: 'onlyVariables.css' },
|
|
73
73
|
{ mode: 'onlyColors', fileName: 'onlyColors.css' },
|
|
74
74
|
{ mode: 'onlyAdaptiveGroups', fileName: 'onlyAdaptiveGroups.css' },
|
|
75
|
+
{ mode: 'noSizes', fileName: 'noSizes.css' },
|
|
75
76
|
].forEach(function (_a) {
|
|
77
|
+
var _b;
|
|
76
78
|
var mode = _a.mode, fileName = _a.fileName;
|
|
77
79
|
var filePath = path_1.default.resolve(themePath, fileName);
|
|
78
80
|
var content = mode === 'default'
|
|
79
|
-
? compileStyles_1.compileStyles('css', theme, 'withAdaptiveGroups') + "\n\n" + compileBreakpointsCssVarsDeclaration_1.compileBreakpointsCssVarsDeclaration(cssWarsTheme)
|
|
81
|
+
? compileStyles_1.compileStyles('css', theme, 'withAdaptiveGroups') + "\n\n" + ((_b = compileBreakpointsCssVarsDeclaration_1.compileBreakpointsCssVarsDeclaration(cssWarsTheme)) !== null && _b !== void 0 ? _b : '')
|
|
80
82
|
: compileStyles_1.compileStyles('css', theme, mode);
|
|
81
83
|
fs_extra_1.default.writeFileSync(filePath, content);
|
|
82
84
|
console.log("\u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0437\u0430\u043F\u0438\u0441\u0430\u043B\u0438 \u0444\u0430\u0439\u043B " + fileName);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import 'css.escape';
|
|
1
2
|
import { PixelifyTheme } from '../../../interfaces/general';
|
|
2
3
|
import { Formats } from './helpers/tokenProcessors';
|
|
3
4
|
export declare const serviceKeys: string[];
|
|
4
|
-
export declare type CompileStylesMode = 'default' | 'onlyVariables' | 'onlyColors' | 'withAdaptiveGroups' | 'onlyAdaptiveGroups';
|
|
5
|
+
export declare type CompileStylesMode = 'default' | 'onlyVariables' | 'onlyColors' | 'withAdaptiveGroups' | 'onlyAdaptiveGroups' | 'noSizes';
|
|
5
6
|
/**
|
|
6
7
|
* Компиллирует строку со стилями (в разных форматах), на основе темы
|
|
7
8
|
*/
|
|
@@ -5,12 +5,14 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.compileStyles = exports.serviceKeys = void 0;
|
|
8
|
+
require("css.escape");
|
|
8
9
|
var common_tags_1 = require("common-tags");
|
|
10
|
+
var getAllButSizes_1 = require("../../helpers/getAllButSizes");
|
|
9
11
|
var getOnlyColors_1 = require("../../helpers/getOnlyColors");
|
|
10
12
|
var unCamelcasify_1 = require("../../helpers/unCamelcasify");
|
|
11
13
|
var tokenProcessors_1 = require("./helpers/tokenProcessors");
|
|
12
14
|
var tokenRecognition_1 = require("./helpers/tokenRecognition");
|
|
13
|
-
exports.serviceKeys = ['breakpoints', 'prefix', '
|
|
15
|
+
exports.serviceKeys = ['breakpoints', 'prefix', 'themeType'];
|
|
14
16
|
/**
|
|
15
17
|
* Компиллирует строку со стилями (в разных форматах), на основе темы
|
|
16
18
|
*/
|
|
@@ -30,8 +32,13 @@ var compileStyles = function (format, theme, mode) {
|
|
|
30
32
|
var result = '';
|
|
31
33
|
var variables = '';
|
|
32
34
|
var groupTokens = '';
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
switch (mode) {
|
|
36
|
+
case 'onlyColors':
|
|
37
|
+
theme = getOnlyColors_1.getOnlyColors(theme);
|
|
38
|
+
break;
|
|
39
|
+
case 'noSizes':
|
|
40
|
+
theme = getAllButSizes_1.getAllButSizes(theme, theme.themeNameBase);
|
|
41
|
+
break;
|
|
35
42
|
}
|
|
36
43
|
Object.keys(theme).forEach(function (key) {
|
|
37
44
|
// пропускаем служебные ключи
|
|
@@ -39,6 +46,11 @@ var compileStyles = function (format, theme, mode) {
|
|
|
39
46
|
return;
|
|
40
47
|
}
|
|
41
48
|
var token = theme[key];
|
|
49
|
+
// если переменная — строка (например, имя темы)
|
|
50
|
+
if (tokenRecognition_1.isString(token, key)) {
|
|
51
|
+
variables += getVariableStatement(getDeclaration(key, prefix), "'" + CSS.escape(token) + "'");
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
42
54
|
// если переменная — цвет
|
|
43
55
|
if (tokenRecognition_1.isColor(token)) {
|
|
44
56
|
Object.keys(token).forEach(function (colorState) {
|
|
@@ -160,6 +160,48 @@ var testData = [
|
|
|
160
160
|
styl: common_tags_1.stripIndent(templateObject_40 || (templateObject_40 = __makeTemplateObject(["\n\t\t\tfont-text--regular() {\n\t\t\t\tfont-size: 15px;\n\t\t\t\tline-height: 20px;\n\t\t\t\tfont-family: Arial;\n\t\t\t\tfont-weight: 500;\n\t\t\t}\n\t\t\tfont-text--compact() {\n\t\t\t\tfont-size: 16px;\n\t\t\t\tline-height: 24px;\n\t\t\t\tfont-family: Arial;\n\t\t\t\tfont-weight: 500;\n\t\t\t}\n\t\t\t"], ["\n\t\t\tfont-text--regular() {\n\t\t\t\tfont-size: 15px;\n\t\t\t\tline-height: 20px;\n\t\t\t\tfont-family: Arial;\n\t\t\t\tfont-weight: 500;\n\t\t\t}\n\t\t\tfont-text--compact() {\n\t\t\t\tfont-size: 16px;\n\t\t\t\tline-height: 24px;\n\t\t\t\tfont-family: Arial;\n\t\t\t\tfont-weight: 500;\n\t\t\t}\n\t\t\t"]))),
|
|
161
161
|
},
|
|
162
162
|
},
|
|
163
|
+
{
|
|
164
|
+
name: 'should compile onlyColors',
|
|
165
|
+
mode: 'onlyColors',
|
|
166
|
+
descriptionTheme: {
|
|
167
|
+
sizeBasePadding: {
|
|
168
|
+
regular: 20,
|
|
169
|
+
},
|
|
170
|
+
colorBackground: {
|
|
171
|
+
normal: '#FFF',
|
|
172
|
+
hover: '#AAA',
|
|
173
|
+
active: '#CCC',
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
result: {
|
|
177
|
+
css: common_tags_1.stripIndent(templateObject_41 || (templateObject_41 = __makeTemplateObject(["\n\t\t\t\t:root {\n\t\t\t\t\t--vkui--color_background: #FFF;\n\t\t\t\t\t--vkui--color_background--hover: #AAA;\n\t\t\t\t\t--vkui--color_background--active: #CCC;\n\t\t\t\t}\n\t\t\t"], ["\n\t\t\t\t:root {\n\t\t\t\t\t--vkui--color_background: #FFF;\n\t\t\t\t\t--vkui--color_background--hover: #AAA;\n\t\t\t\t\t--vkui--color_background--active: #CCC;\n\t\t\t\t}\n\t\t\t"]))),
|
|
178
|
+
scss: common_tags_1.stripIndent(templateObject_42 || (templateObject_42 = __makeTemplateObject(["\n\t\t\t\t$color-background: #FFF;\n\t\t\t\t$color-background--hover: #AAA;\n\t\t\t\t$color-background--active: #CCC;\n\t\t\t"], ["\n\t\t\t\t$color-background: #FFF;\n\t\t\t\t$color-background--hover: #AAA;\n\t\t\t\t$color-background--active: #CCC;\n\t\t\t"]))),
|
|
179
|
+
pcss: common_tags_1.stripIndent(templateObject_43 || (templateObject_43 = __makeTemplateObject(["\n\t\t\t\t:root {\n\t\t\t\t\t--color-background: #FFF;\n\t\t\t\t\t--color-background--hover: #AAA;\n\t\t\t\t\t--color-background--active: #CCC;\n\t\t\t\t}"], ["\n\t\t\t\t:root {\n\t\t\t\t\t--color-background: #FFF;\n\t\t\t\t\t--color-background--hover: #AAA;\n\t\t\t\t\t--color-background--active: #CCC;\n\t\t\t\t}"]))),
|
|
180
|
+
less: common_tags_1.stripIndent(templateObject_44 || (templateObject_44 = __makeTemplateObject(["\n\t\t\t\t@color-background: #FFF;\n\t\t\t\t@color-background--hover: #AAA;\n\t\t\t\t@color-background--active: #CCC;\n\t\t\t"], ["\n\t\t\t\t@color-background: #FFF;\n\t\t\t\t@color-background--hover: #AAA;\n\t\t\t\t@color-background--active: #CCC;\n\t\t\t"]))),
|
|
181
|
+
styl: common_tags_1.stripIndent(templateObject_45 || (templateObject_45 = __makeTemplateObject(["\n\t\t\t\t$color-background = #FFF;\n\t\t\t\t$color-background--hover = #AAA;\n\t\t\t\t$color-background--active = #CCC;\n\t\t\t"], ["\n\t\t\t\t$color-background = #FFF;\n\t\t\t\t$color-background--hover = #AAA;\n\t\t\t\t$color-background--active = #CCC;\n\t\t\t"]))),
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: 'should compile noSizes',
|
|
186
|
+
mode: 'noSizes',
|
|
187
|
+
descriptionTheme: {
|
|
188
|
+
sizeBasePadding: {
|
|
189
|
+
regular: 20,
|
|
190
|
+
},
|
|
191
|
+
colorBackground: {
|
|
192
|
+
normal: '#FFF',
|
|
193
|
+
hover: '#AAA',
|
|
194
|
+
active: '#CCC',
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
result: {
|
|
198
|
+
css: common_tags_1.stripIndent(templateObject_46 || (templateObject_46 = __makeTemplateObject(["\n\t\t\t\t:root {\n\t\t\t\t\t--vkui--color_background: #FFF;\n\t\t\t\t\t--vkui--color_background--hover: #AAA;\n\t\t\t\t\t--vkui--color_background--active: #CCC;\n\t\t\t\t}\n\t\t\t"], ["\n\t\t\t\t:root {\n\t\t\t\t\t--vkui--color_background: #FFF;\n\t\t\t\t\t--vkui--color_background--hover: #AAA;\n\t\t\t\t\t--vkui--color_background--active: #CCC;\n\t\t\t\t}\n\t\t\t"]))),
|
|
199
|
+
scss: common_tags_1.stripIndent(templateObject_47 || (templateObject_47 = __makeTemplateObject(["\n\t\t\t\t$color-background: #FFF;\n\t\t\t\t$color-background--hover: #AAA;\n\t\t\t\t$color-background--active: #CCC;\n\t\t\t"], ["\n\t\t\t\t$color-background: #FFF;\n\t\t\t\t$color-background--hover: #AAA;\n\t\t\t\t$color-background--active: #CCC;\n\t\t\t"]))),
|
|
200
|
+
pcss: common_tags_1.stripIndent(templateObject_48 || (templateObject_48 = __makeTemplateObject(["\n\t\t\t\t:root {\n\t\t\t\t\t--color-background: #FFF;\n\t\t\t\t\t--color-background--hover: #AAA;\n\t\t\t\t\t--color-background--active: #CCC;\n\t\t\t\t}"], ["\n\t\t\t\t:root {\n\t\t\t\t\t--color-background: #FFF;\n\t\t\t\t\t--color-background--hover: #AAA;\n\t\t\t\t\t--color-background--active: #CCC;\n\t\t\t\t}"]))),
|
|
201
|
+
less: common_tags_1.stripIndent(templateObject_49 || (templateObject_49 = __makeTemplateObject(["\n\t\t\t\t@color-background: #FFF;\n\t\t\t\t@color-background--hover: #AAA;\n\t\t\t\t@color-background--active: #CCC;\n\t\t\t"], ["\n\t\t\t\t@color-background: #FFF;\n\t\t\t\t@color-background--hover: #AAA;\n\t\t\t\t@color-background--active: #CCC;\n\t\t\t"]))),
|
|
202
|
+
styl: common_tags_1.stripIndent(templateObject_50 || (templateObject_50 = __makeTemplateObject(["\n\t\t\t\t$color-background = #FFF;\n\t\t\t\t$color-background--hover = #AAA;\n\t\t\t\t$color-background--active = #CCC;\n\t\t\t"], ["\n\t\t\t\t$color-background = #FFF;\n\t\t\t\t$color-background--hover = #AAA;\n\t\t\t\t$color-background--active = #CCC;\n\t\t\t"]))),
|
|
203
|
+
},
|
|
204
|
+
},
|
|
163
205
|
];
|
|
164
206
|
describe('compileStyles', function () {
|
|
165
207
|
Object.values(tokenProcessors_1.EStyleTypes).forEach(function (format) {
|
|
@@ -173,4 +215,4 @@ describe('compileStyles', function () {
|
|
|
173
215
|
});
|
|
174
216
|
});
|
|
175
217
|
});
|
|
176
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32, templateObject_33, templateObject_34, templateObject_35, templateObject_36, templateObject_37, templateObject_38, templateObject_39, templateObject_40;
|
|
218
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25, templateObject_26, templateObject_27, templateObject_28, templateObject_29, templateObject_30, templateObject_31, templateObject_32, templateObject_33, templateObject_34, templateObject_35, templateObject_36, templateObject_37, templateObject_38, templateObject_39, templateObject_40, templateObject_41, templateObject_42, templateObject_43, templateObject_44, templateObject_45, templateObject_46, templateObject_47, templateObject_48, templateObject_49, templateObject_50;
|
|
@@ -2,6 +2,7 @@ import { ColorWithStates } from '../../../../interfaces/general/colors';
|
|
|
2
2
|
import { Adaptive } from '../../../../interfaces/general/tools';
|
|
3
3
|
import { CustomMediaByViewportUnion } from '../../../../interfaces/general/tools/customMedia';
|
|
4
4
|
import { ViewportsTuple } from '../../../../interfaces/general/tools/viewports';
|
|
5
|
+
export declare function isString(token: any, key: string): token is string;
|
|
5
6
|
export declare function isColor(token: any): token is ColorWithStates;
|
|
6
7
|
export declare function isGroupToken(token: any): token is Record<string, any>;
|
|
7
8
|
export declare function isAdaptiveFlatToken(token: any): token is Adaptive<any>;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isCustomMediaToken = exports.isAdaptiveFlatToken = exports.isGroupToken = exports.isColor = void 0;
|
|
3
|
+
exports.isCustomMediaToken = exports.isAdaptiveFlatToken = exports.isGroupToken = exports.isColor = exports.isString = void 0;
|
|
4
4
|
var customMedia_1 = require("../../../themeProcessors/customMedia/customMedia");
|
|
5
|
+
var stringKeys = ['themeName', 'themeNameBase'];
|
|
6
|
+
function isString(token, key) {
|
|
7
|
+
return typeof token === 'string' && stringKeys.includes(key);
|
|
8
|
+
}
|
|
9
|
+
exports.isString = isString;
|
|
5
10
|
function isColor(token) {
|
|
6
11
|
if (typeof token !== 'object') {
|
|
7
12
|
return false;
|
|
@@ -102,9 +102,9 @@ describe('expandTheme', function () {
|
|
|
102
102
|
value: 'var(--vkui--colors_scheme, light)',
|
|
103
103
|
},
|
|
104
104
|
someNewRandomToken: {
|
|
105
|
-
name: '--vkui--
|
|
105
|
+
name: '--vkui--some_new_random_token',
|
|
106
106
|
originalValue: '3',
|
|
107
|
-
value: 'var(--vkui--
|
|
107
|
+
value: 'var(--vkui--some_new_random_token, 3)',
|
|
108
108
|
},
|
|
109
109
|
themeType: 'cssVarsWide',
|
|
110
110
|
});
|
|
@@ -137,8 +137,8 @@ describe('expandTheme', function () {
|
|
|
137
137
|
value: 'var(--vkui--colors_scheme, light)',
|
|
138
138
|
},
|
|
139
139
|
someNewRandomToken: {
|
|
140
|
-
name: '--vkui--
|
|
141
|
-
value: 'var(--vkui--
|
|
140
|
+
name: '--vkui--some_new_random_token',
|
|
141
|
+
value: 'var(--vkui--some_new_random_token, 3)',
|
|
142
142
|
},
|
|
143
143
|
themeType: 'cssVars',
|
|
144
144
|
});
|
|
@@ -6,7 +6,7 @@ exports.convertCamelToSnake = void 0;
|
|
|
6
6
|
*/
|
|
7
7
|
function convertCamelToSnake(str) {
|
|
8
8
|
return str
|
|
9
|
-
.replace(/
|
|
9
|
+
.replace(/([A-Z])/g, function (letter) { return "_" + letter.toLowerCase(); })
|
|
10
10
|
.replace(/^_/, '');
|
|
11
11
|
}
|
|
12
12
|
exports.convertCamelToSnake = convertCamelToSnake;
|
|
@@ -17,4 +17,7 @@ describe('convertCamelToSnake', function () {
|
|
|
17
17
|
it('should convert many words string', function () {
|
|
18
18
|
expect(convertCamelToSnake_1.convertCamelToSnake('helloWorldMyFriend')).toBe('hello_world_my_friend');
|
|
19
19
|
});
|
|
20
|
+
it('should convert special case 1', function () {
|
|
21
|
+
expect(convertCamelToSnake_1.convertCamelToSnake('octaviusShadowLetterList')).toBe('octavius_shadow_letter_list');
|
|
22
|
+
});
|
|
20
23
|
});
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { ColorDescription, ColorDescriptionCallable, ColorDescriptionStatic, ColorWithStates } from '../../interfaces/general/colors';
|
|
2
|
+
export declare function isColorWithStates(value: unknown): value is ColorWithStates;
|
|
3
|
+
export declare function isColorDescriptionCallable(value: unknown): value is ColorDescriptionCallable<any>;
|
|
4
|
+
export declare function isColorDescriptionStatic(value: unknown): value is ColorDescriptionStatic;
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated
|
|
7
|
+
* use toneOpacity
|
|
8
|
+
* TODO: remove
|
|
9
|
+
*/
|
|
10
|
+
export declare function getRGBA(color: ColorDescription, opacity: number): ColorDescription;
|
|
11
|
+
export declare function toneOpacity(color: string, opacity: number): string;
|
|
12
|
+
export declare function toneOpacity(color: ColorDescription, opacity: number): ColorDescription;
|
|
@@ -1,13 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRGBA = void 0;
|
|
3
|
+
exports.toneOpacity = exports.getRGBA = exports.isColorDescriptionStatic = exports.isColorDescriptionCallable = exports.isColorWithStates = void 0;
|
|
4
4
|
var hexToRgb = function (hex) {
|
|
5
5
|
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
6
6
|
return result
|
|
7
7
|
? parseInt(result[1], 16) + ", " + parseInt(result[2], 16) + ", " + parseInt(result[3], 16)
|
|
8
8
|
: '';
|
|
9
9
|
};
|
|
10
|
+
function isColorWithStates(value) {
|
|
11
|
+
return (value &&
|
|
12
|
+
typeof value === 'object' &&
|
|
13
|
+
typeof value['normal'] === 'string' &&
|
|
14
|
+
typeof value['hover'] === 'string' &&
|
|
15
|
+
typeof value['active'] === 'string');
|
|
16
|
+
}
|
|
17
|
+
exports.isColorWithStates = isColorWithStates;
|
|
18
|
+
function isColorDescriptionCallable(value) {
|
|
19
|
+
return typeof value === 'function';
|
|
20
|
+
}
|
|
21
|
+
exports.isColorDescriptionCallable = isColorDescriptionCallable;
|
|
22
|
+
function isColorDescriptionStatic(value) {
|
|
23
|
+
return typeof value === 'string' || isColorWithStates(value);
|
|
24
|
+
}
|
|
25
|
+
exports.isColorDescriptionStatic = isColorDescriptionStatic;
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated
|
|
28
|
+
* use toneOpacity
|
|
29
|
+
* TODO: remove
|
|
30
|
+
*/
|
|
10
31
|
function getRGBA(color, opacity) {
|
|
11
|
-
|
|
32
|
+
if (isColorDescriptionStatic(color)) {
|
|
33
|
+
if (isColorWithStates(color)) {
|
|
34
|
+
return "rgba(" + hexToRgb(color.normal) + ", " + opacity + ")";
|
|
35
|
+
}
|
|
36
|
+
return "rgba(" + hexToRgb(color) + ", " + opacity + ")";
|
|
37
|
+
}
|
|
38
|
+
return function (theme) {
|
|
39
|
+
return getRGBA(color(theme), opacity);
|
|
40
|
+
};
|
|
12
41
|
}
|
|
13
42
|
exports.getRGBA = getRGBA;
|
|
43
|
+
function toneOpacity(color, opacity) {
|
|
44
|
+
return getRGBA(color, opacity);
|
|
45
|
+
}
|
|
46
|
+
exports.toneOpacity = toneOpacity;
|
|
@@ -10,4 +10,16 @@ describe('cssHelpers', function () {
|
|
|
10
10
|
expect(cssHelpers_1.getRGBA('#ffff00', 0.2)).toBe('rgba(255, 255, 0, 0.2)');
|
|
11
11
|
});
|
|
12
12
|
});
|
|
13
|
+
describe('toneOpacity', function () {
|
|
14
|
+
it('should work with string', function () {
|
|
15
|
+
expect(cssHelpers_1.toneOpacity('#f00000', 0.5)).toBe('rgba(240, 0, 0, 0.5)');
|
|
16
|
+
});
|
|
17
|
+
it('should work with ColorWithStates', function () {
|
|
18
|
+
expect(cssHelpers_1.toneOpacity({
|
|
19
|
+
normal: '#f00000',
|
|
20
|
+
hover: '#f00000',
|
|
21
|
+
active: '#f00000',
|
|
22
|
+
}, 0.5)).toBe('rgba(240, 0, 0, 0.5)');
|
|
23
|
+
});
|
|
24
|
+
});
|
|
13
25
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getAllButSizes(theme: Record<string, any>, themeNameBase?: unknown): any;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAllButSizes = void 0;
|
|
4
|
+
var regexSize = /^(size|font|x\d+)/i;
|
|
5
|
+
function getAllButSizes(theme, themeNameBase) {
|
|
6
|
+
return Object.keys(theme).reduce(function (acc, key) {
|
|
7
|
+
var value = theme[key];
|
|
8
|
+
var lookupKey = typeof themeNameBase === 'string' && key.startsWith(themeNameBase)
|
|
9
|
+
? key.slice(themeNameBase.length)
|
|
10
|
+
: key;
|
|
11
|
+
if (!regexSize.test(lookupKey)) {
|
|
12
|
+
acc[key] = value;
|
|
13
|
+
}
|
|
14
|
+
return acc;
|
|
15
|
+
}, {});
|
|
16
|
+
}
|
|
17
|
+
exports.getAllButSizes = getAllButSizes;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var getAllButSizes_1 = require("./getAllButSizes");
|
|
4
|
+
describe('getAllButSizes', function () {
|
|
5
|
+
it('should filter out tokens that start with "size", "font" or are a size helper', function () {
|
|
6
|
+
expect(getAllButSizes_1.getAllButSizes({
|
|
7
|
+
colorBackground: '#FFF',
|
|
8
|
+
sizePaddingBase: 20,
|
|
9
|
+
fontText: {
|
|
10
|
+
fontFamily: 'Comic Sans',
|
|
11
|
+
},
|
|
12
|
+
x10: 5,
|
|
13
|
+
xxxTokenXxx: '8',
|
|
14
|
+
octaviusColorBackground: '#ACA',
|
|
15
|
+
octaviusSizePaddingBase: 8,
|
|
16
|
+
}, 'octavius')).toEqual({
|
|
17
|
+
colorBackground: '#FFF',
|
|
18
|
+
xxxTokenXxx: '8',
|
|
19
|
+
octaviusColorBackground: '#ACA',
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var getOnlyColors_1 = require("./getOnlyColors");
|
|
4
|
+
describe('getOnlyColors', function () {
|
|
5
|
+
it('should filter out tokens that do not look like a color', function () {
|
|
6
|
+
expect(getOnlyColors_1.getOnlyColors({
|
|
7
|
+
colorBackground: {
|
|
8
|
+
normal: '#FFF',
|
|
9
|
+
},
|
|
10
|
+
sizePaddingBase: 20,
|
|
11
|
+
})).toEqual({
|
|
12
|
+
colorBackground: {
|
|
13
|
+
normal: '#FFF',
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { ColorsDescription, ColorsFinal } from '../../../interfaces/general';
|
|
2
|
-
import { ColorDescription, ColorsDescriptionStruct } from '../../../interfaces/general/colors';
|
|
2
|
+
import { ColorDescription, ColorsDescriptionStruct, ColorWithStates } from '../../../interfaces/general/colors';
|
|
3
3
|
export declare const colorStateMap: {
|
|
4
4
|
readonly light: "#00103D";
|
|
5
5
|
readonly dark: "#FFFFFF";
|
|
6
6
|
};
|
|
7
|
+
export declare function expandColor<T extends {
|
|
8
|
+
[key in keyof T]: ColorDescription;
|
|
9
|
+
} = ColorsDescriptionStruct>(color: ColorDescription<T>, theme: Partial<ColorsDescription<T>>): ColorWithStates;
|
|
7
10
|
/**
|
|
8
11
|
* Процессор, который формирует из описания темы (ThemeDescription)
|
|
9
12
|
* цвета со всеми состояниями active, hover и normal
|