addons/components/theme/tokens.stylex.tsblame
View source
b69ab311/**
b69ab312 * Copyright (c) Meta Platforms, Inc. and affiliates.
b69ab313 *
b69ab314 * This source code is licensed under the MIT license found in the
b69ab315 * LICENSE file in the root directory of this source tree.
b69ab316 */
b69ab317
b69ab318import * as stylex from '@stylexjs/stylex';
b69ab319
b69ab3110/*
b69ab3111This file defines theme variables usable in StyleX styles.
b69ab3112 */
b69ab3113
b69ab3114// default is dark theme
b69ab3115export const colors = stylex.defineVars({
b69ab3116 bg: 'var(--background)',
b69ab3117 fg: 'var(--foreground)',
b69ab3118 brightFg: 'white',
b69ab3119 focusBorder: 'var(--focus-border)',
b69ab3120
b69ab3121 hoverDarken: 'rgba(255, 255, 255, 0.1)',
b69ab3122 subtleHoverDarken: 'rgba(255, 255, 255, 0.03)',
b69ab3123 highlightFg: '#f0f0f0',
b69ab3124
b69ab3125 modifiedFg: '#e2c08d',
b69ab3126 addedFg: '#73c991',
b69ab3127 removedFg: '#f3674f',
b69ab3128 missingFg: '#b4eaed',
b69ab3129
b69ab3130 tooltipBg: 'var(--vscode-editorWidget-background, #252526)',
b69ab3131 tooltipBorder: 'var(--vscode-editorWidget-border, #454545)',
b69ab3132
b69ab3133 purple: '#713fc8',
b69ab3134 red: '#cf222e',
b69ab3135 yellow: '#e0d12d',
b69ab3136 orange: '#dd7c26',
b69ab3137 green: '#2da44e',
b69ab3138 blue: '#007acc',
b69ab3139 grey: '#5f6a79',
b69ab3140
b69ab3141 signalFg: 'white',
b69ab3142 signalGoodBg: '#2da44e',
b69ab3143 signalMediumBg: '#e0d12d',
b69ab3144 signalBadBg: '#cf222e',
b69ab3145
b69ab3146 errorFg: '#f3674f',
b69ab3147 errorBg: '#f3674f20',
b69ab3148
b69ab3149 landFg: 'white',
b69ab3150 landBg: '#24853c',
b69ab3151 landHoverBg: '#207134',
b69ab3152});
b69ab3153
b69ab3154// if using a light theme, we apply a stylex theme to override color variables above
b69ab3155export const light = stylex.createTheme(colors, {
b69ab3156 bg: 'var(--background)',
b69ab3157 fg: 'var(--foreground)',
b69ab3158 brightFg: 'black',
b69ab3159 focusBorder: 'var(--focus-border)',
b69ab3160
b69ab3161 hoverDarken: 'rgba(0, 0, 0, 0.1)',
b69ab3162 subtleHoverDarken: 'rgba(0, 0, 0, 0.03)',
b69ab3163 highlightFg: '#2a2a2a',
b69ab3164
b69ab3165 modifiedFg: '#895503',
b69ab3166 addedFg: '#007100',
b69ab3167 removedFg: '#ad0707',
b69ab3168 missingFg: '#418c91',
b69ab3169
b69ab3170 tooltipBg: 'var(--vscode-editorWidget-background, #f3f3f3)',
b69ab3171 tooltipBorder: 'var(--vscode-editorWidget-border, #c8c8c8)',
b69ab3172
b69ab3173 purple: '#713fc8',
b69ab3174 red: '#cf222e',
b69ab3175 yellow: '#e0d12d',
b69ab3176 orange: '#dd7c26',
b69ab3177 green: '#2da44e',
b69ab3178 blue: '#007acc',
b69ab3179 grey: '#5f6a79',
b69ab3180
b69ab3181 signalFg: 'white',
b69ab3182 signalGoodBg: '#2da44e',
b69ab3183 signalMediumBg: '#e0d12d',
b69ab3184 signalBadBg: '#cf222e',
b69ab3185
b69ab3186 errorFg: '#e35941ff',
b69ab3187 errorBg: '#e3594120',
b69ab3188
b69ab3189 landFg: 'white',
b69ab3190 landBg: '#24853c',
b69ab3191 landHoverBg: '#207134',
b69ab3192});
b69ab3193
b69ab3194export const spacing = stylex.defineVars({
b69ab3195 none: '0px',
b69ab3196 quarter: '2.5px',
b69ab3197 half: '5px',
b69ab3198 pad: '10px',
b69ab3199 double: '20px',
b69ab31100 xlarge: '32px',
b69ab31101 xxlarge: '48px',
b69ab31102 xxxlarge: '96px',
b69ab31103});
b69ab31104
b69ab31105export const radius = stylex.defineVars({
b69ab31106 small: '2.5px',
b69ab31107 round: '5px',
b69ab31108 extraround: '5px',
b69ab31109 full: '50%',
b69ab31110});
b69ab31111
b69ab31112export const font = stylex.defineVars({
b69ab31113 smaller: '80%',
b69ab31114 small: '90%',
b69ab31115 normal: '100%',
b69ab31116 big: '110%',
b69ab31117 bigger: '120%',
b69ab31118});