Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

site: Update example bgs from checkers to dots #1526

Merged
merged 3 commits into from
Jun 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 11 additions & 15 deletions site/src/App/ThemeSetting/ThemedExample.css.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { palette } from 'braid-src/lib/color/palette';
import { colorModeStyle } from 'braid-src/entries/css';
import { createVar, style } from '@vanilla-extract/css';
import tokens from 'braid-src/lib/themes/docs/tokens';
Expand All @@ -6,27 +7,23 @@ export const unthemedBorderRadius = style({
borderRadius: tokens.border.radius.large,
});

const bgColor = createVar();
const cubeColor = createVar();
const cubeSize = createVar();
const dotColor = createVar();
const dotSize = createVar();
const dotOffset = createVar();
export const canvas = style([
{
vars: {
[cubeSize]: '12px',
[dotSize]: `${tokens.grid * 2}px`,
[dotOffset]: `calc((${dotSize} / 2) * -1)`,
},
backgroundColor: bgColor,
backgroundImage: [
`linear-gradient(45deg, ${cubeColor} 25%, transparent 25%, transparent 75%, ${cubeColor} 75%, ${cubeColor})`,
`linear-gradient(45deg, ${cubeColor} 25%, transparent 25%, transparent 75%, ${cubeColor} 75%, ${cubeColor})`,
].join(', '),
backgroundSize: `calc(${cubeSize} * 2) calc(${cubeSize} * 2)`,
backgroundPosition: `0 0, ${cubeSize} ${cubeSize}`,
backgroundImage: `radial-gradient(${dotColor} 1px, transparent 0)`,
backgroundSize: `${dotSize} ${dotSize}`,
backgroundPosition: `${dotOffset} ${dotOffset}`,
},
]);

const darkVars = {
[cubeColor]: 'rgba(255,255,255, .08)',
[bgColor]: tokens.color.background.bodyDark,
[dotColor]: palette.grey[800],
};
export const explicitDark = style({
vars: darkVars,
Expand All @@ -36,8 +33,7 @@ export const adaptiveCanvas = style(
colorModeStyle({
lightMode: {
vars: {
[cubeColor]: 'rgba(0,0,0, .04)',
[bgColor]: tokens.color.background.body,
[dotColor]: palette.grey[100],
},
},
darkMode: {
Expand Down