GithubHelp home page GithubHelp logo

wayfair / rainbow-sprinkles Goto Github PK

View Code? Open in Web Editor NEW
195.0 9.0 16.0 29.16 MB

Dynamic, theme-driven, style props for vanilla-extract.

License: MIT License

JavaScript 0.71% TypeScript 99.29%
css design-system react styled-system typescript vanilla-extract css-in-js

rainbow-sprinkles's Introduction

Rainbow Sprinkles ๐Ÿง

Dynamic, theme-driven, style props for vanilla-extract

Release license: MIT Contributor Covenant Maintainer

Rainbow sprinkles works similarly to @vanilla-extract/sprinkles. Like sprinkles, it generates custom CSS utility classes at build time. While sprinkles requires a pre-defined list of available values, Rainbow Sprinkles uses CSS custom properties to allow dynamic values using inline style variable assignments.

Compared to sprinkles:

  • Rainbow sprinkles ships a fraction of the CSS. For each property, Sprinkles produces CSS that's a factor of [pre-defined values] * [possible conditions]. Rainbow sprinkles produces CSS that only scales with the number of conditions.
  • Supports dynamic values. Rainbow Sprinkles uses dynamic inline style assignments to set the value of each property. You still get the TypeScript editor suggestions, but the ability to use any valid CSS value for that property.

function App() {
  return (
    // Use pre-defined values
    <Box bg="$blue50" margin="$large">
      {/* Or any valid CSS value */}
      <Box textAlign="center" fontSize="30px">
        Hello world!
      </Box>
    </Box>
  );
}

See a stackblitz demo here!


Setup

Install Rainbow Sprinkles.

npm install rainbow-sprinkles

Create a rainbow-sprinkles.css.ts file, then create and export your rainbowSprinkles function:

// rainbow-sprinkles.css.ts
import { defineProperties, createRainbowSprinkles } from 'rainbow-sprinkles';

// or import a theme (e.g. `createTheme`, `createThemeContract`)
const vars = {
  space: {
    none: '0',
    small: '4px',
    medium: '8px',
    large: '16px',
    // etc.
  },
  colors: {
    blue50: '#eff6ff',
    blue100: '#dbeafe',
    blue200: '#bfdbfe',
    gray700: '#374151',
    gray800: '#1f2937',
    gray900: '#111827',
    // etc.
  },
};

const responsiveProperties = defineProperties({
  conditions: {
    mobile: {},
    tablet: { '@media': 'screen and (min-width: 768px)' },
    desktop: { '@media': 'screen and (min-width: 1024px)' },
  },
  defaultCondition: 'mobile',
  dynamicProperties: {
    // Define pre-determined values, which will be autosuggested
    color: vars.colors,
    backgroundColor: vars.colors,
    margin: vars.space,
    marginTop: vars.space,
    marginLeft: vars.space,
    marginRight: vars.space,
    marginBottom: vars.space,
    // Will work with any CSS value
    display: true,
    textAlign: true,
    flexDirection: true,
    justifyContent: true,
    alignItems: true,
  },
  staticProperties: {
    // Build out utility classes that don't use CSS variables
    display: ['block', 'flex', 'inline-block', 'inline-flex'],
  },
  shorthands: {
    bg: ['backgroundColor'],
    m: ['margin'],
    mr: ['marginRight'],
    ml: ['marginLeft'],
    mt: ['marginTop'],
    mb: ['marginBottom'],
    marginX: ['marginLeft', 'marginRight'],
    marginY: ['marginTop', 'marginBottom'],
    mx: ['marginLeft', 'marginRight'],
    my: ['marginTop', 'marginBottom'],
  },
});

export const rainbowSprinkles = createRainbowSprinkles(responsiveProperties);

export type Sprinkles = Parameters<typeof rainbowSprinkles>[0];

Then set-up in your "host" component (in this case, a Box component):

// Box.tsx
import { rainbowSprinkles, Sprinkles } from './rainbow-sprinkles.css';

interface BoxProps extends Sprinkles {
  children?: React.ReactNode;
}

export const Box = ({ children, ...props }: BoxProps) => {
  const { className, style, otherProps } = rainbowSprinkles(props);

  return (
    <div className={className} style={style} {...otherProps}>
      {children}
    </div>
  );
};

๐ŸŽ‰ Good to go!

// App.tsx
import { Box } from './Box';

function App() {
  return (
    // Use pre-defined values
    <Box bg="$blue50" margin="$medium $large">
      {/* Or any valid CSS value */}
      <Box textAlign="center" fontSize={{ mobile: '16px', desktop: '32px' }}>
        Hello world!
      </Box>
    </Box>
  );
}

CSS Layers

You can define a css layer for a given set of properties.

// rainbow-sprinkles.css.ts
import { layer } from '@vanilla-extract/css';
import { defineProperties } from 'rainbow-sprinkles';

export const sprinklesLayer = layer();

const properties = defineProperties({
  '@layer': sprinklesLayer
  // etc.
});

dynamicProperties vs staticProperties

One trade off that's made for supporting dynamic values is that we have to increase the size of the document. Instead of just appending a single class to an element to add a style, both a utility class and an inline style assignment is added to an element. While this setup will still produce an overall smaller bundle in many cases, some large applications may observe frequent recurrence of specific combinations of CSS properties and values. In these cases, those combinations can be set-up in staticProperties in the initial configuration. staticProperties will produce typical CSS utility classes. The runtime portion of Rainbow Sprinkles will defer to the CSS classes created by staticProperties and not apply any inline style assignments.

Here's an example scenario in which this property could be valuable. Your organization sets up Rainbow Sprinkles and sees widespread adoption. Your metrics reveal that the most frequently used prop/value combinations is display="flex" and margin with the application's theme variables. You can run an experiment to evaluate whether making these property/values combination static improves the bundle size.

createRainbowSprinkles({
  dynamicProperties: {
    // Still support arbitrary values
    display: true,
    margin: true,
  },
  staticProperties: {
    // Also produce fixed CSS classes
    display: ['flex'],
    margin: vars.space,
  },
});

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated. For detailed contributing guidelines, please see CONTRIBUTING.md

Thanks

  • Vanilla Extract for creating an inovative and configurable CSS preprocessor
  • Styled System for inventing theme-driven style props
  • Homebase, Wayfair's design system, for providing interesting problems to solve

License

Distributed under the MIT License. See LICENSE for more information.

Contact

rainbow-sprinkles's People

Contributors

aspirisen avatar changjunekim avatar dependabot[bot] avatar folz avatar garypwhite avatar github-actions[bot] avatar hamlim avatar kbondanza avatar mooronic avatar renovate[bot] avatar richbachman avatar roginfarrer avatar sebtoombs avatar simontaisne avatar skyesong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rainbow-sprinkles's Issues

Move vars access to runtime?

Problem Statement

Creating rainbowSprinkles and passing vars scales to the configuration object currently results in duplication of each scale into the final bundle. To illustrate, let's look at this common set-up:

import vars from '../vars.css';

export const rainbowSprinkles = createRainbowSprinkles({
  dynamicProperties: {
    margin: vars.space,
    marginLeft: vars.space,
    marginRight: vars.space,
    marginBottom: vars.space,
    marginTop: vars.space
  }
)};

When generating the runtime function, we assign the given scales to each property:

{
  margin: {
    vars: { .. },
    classes: { .. },
    name: 'margin',
    scale: {
      // vars.space
      1x: '2px',
      2x: '4px',
      3x: '8px',
      4x: '16px'
    }
  }
}

This scale object gets repeated for each margin property. This situation is a bit more severe for scales like color, which can have dozens of properties.

Proposed Solution

One solution to this would be to move vars lookup to runtime using a "get" function.

// rainbow-sprinkles.css.ts
export const rainbowSprinkles = createRainbowSprinkles({
  dynamicProperties: {
    margin: 'space',
    marginLeft: 'space',
    marginRight: 'space',
    marginBottom: 'space',
    marginTop: 'space'
  }
});
// Box.tsx
import {rainbowSprinkles} from './rainbow-sprinkles.css';
import {vars} from '../vars.css';

export const Box = (props) => {
  const {style, className, otherProps} = rainbowSprinkles(props, vars);

  return <Box style={style} className={className} {...otherProps} />
};

During runtime rainbowSprinkles would evaluate look up the value $2x with get(vars, 'space.2x').

Pros

  • Reduces overall bundle size
  • get can be memoized (as can more of the runtime of rainbowSprinkles)

Cons

  • Moves bundle size to runtime

Alternatives Considered

Some bundlers will minify the references to the scales. For example, I see this in my implementation of rainbow sprinkles:

// dist/Box.css.js
x.config.backgroundColor[0].scale = x.config.color[0].scale;
x.config.margin[0].scale = x.config.padding[0].scale;
x.config.marginTop[0].scale = x.config.padding[0].scale;
x.config.marginLeft[0].scale = x.config.padding[0].scale;
x.config.marginRight[0].scale = x.config.padding[0].scale;
x.config.marginBottom[0].scale = x.config.padding[0].scale;

So this diminishes the overall bundle size considerably. But we're maybe still shipping repetitions of the vars object in the overall bundle.

Additional Context

N/A

Properties declared in both `staticProperties` and `dynamicProperties` have inline styles applied

Description

I've got a static property of {full: "100%"} for height. I also have height: true to allow for arbitrary height values. The appearance is correct, but the HTML has unnecessary inline styles applied. (ex: a $full design token as a custom property value)

CleanShot 2023-02-15 at 13 03 36@2x

Expected Behaviour

The inline style declaring $full should not be applied.

Actual Behaviour

The inline style declaring $full is applied.

Affected Version

0.15.2

Steps to Reproduce

  1. Create static property of height: {full: "100%"}
  2. Create dynamic property of height: true
  3. Use like so <Box height="$full" />

Checklist

Support responsiveArray

Problem Statement

allow responsiveArray option in defineProperties.

probably need to attach the responsiveArray into each config, and loop propValue if it's array

TS2742 type annotation necessary for basic usage

Description

When converting from vanilla-extract/sprinkles to rainbow-sprinkles, Typescript 5.2 gets tripped up with a confusing error:

The inferred type of 'sprinkles' cannot be named without a reference to '../../node_modules/rainbow-sprinkles/dist/declarations/src/createRuntimeFn'. This is likely not portable. A type annotation is necessary.ts(2742)

Expected Behaviour

Proper inferred typing.

Actual Behaviour

typescript build fails

Affected Version

0.17.0

Steps to Reproduce

Possibly the tsconfig?

  "compilerOptions": {
    "incremental": true,
    "lib": [
      "ES2022",
      "DOM"
    ],
    "target": "ES2022",
    "module": "NodeNext",
    "allowJs": true,
    "preserveWatchOutput": true,
    "outDir": "dist/",
    "strict": true,
    "declaration": true,
    "sourceMap": true,
    "isolatedModules": true,
    "moduleResolution": "NodeNext",
    "baseUrl": "./src",
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "experimentalDecorators": true,
    "resolveJsonModule": true,
    "forceConsistentCasingInFileNames": true,
    "jsx": "preserve",
    "paths": {
      "@/*": [
        "./*"
      ]
    },
    "noEmit": true,
    "skipLibCheck": true
  }

Checklist

Potential TS bug when using a Box as other components

Description

I'm running into a TypeScript error when using a Box component built with rainbow-sprinkles as a Button. Here is a screenshot of the error:

Screenshot 2023-02-26 at 3 24 40 PM

Here is the Box component: https://github.com/richbachman/vega-ui/blob/main/packages/ui/src/primitives/Box/src/index.tsx
Here are the atoms I'm passing to Rainbox Sprinkles: https://github.com/richbachman/vega-ui/blob/main/packages/ui/src/styles/style-props.css.ts

The Button component consists of a main component which loads separate components depending on the variant:

I know I'm passing a lot of dynamicProperties in the defineProperties function. Maybe too many?

Let me know if you have any ideas on why this might be happening. Thanks!

Also note this is very much a WIP, so there's some commented code and other libraries being used to test different ideas. I'd really like to stick with rainbow-sprinkles though.

Expected Behaviour

I expect there to be no TypeScript error.

Actual Behaviour

There's a TypeScript error. This only appears to happen when type checking and in VSCode. The Storybook and the build will run fine.

Affected Version

0.15.2

Steps to Reproduce

  1. Feel free to pull the repo
  2. Run pnpm install
  3. Run pnpm build
  4. Run pnpm type-check to see the error

Checklist

Support variables with \s in their names?

Problem Statement

Currently there's an unspoken support for token objects that follow traditional JS variable naming. However, for our design system we've opted for a human-readable taxonomy which means our tokens are non-traditional. Eg Background Subtle or Background Subtle - Elevated .

Proposed Solution

I poked around and it seems like the regex being used is the limiting factor here. I'm wondering if you've considered making the regex more generic and to really only care about the initial $ in the variable name? I've poked around with changing it to include spaces for example and everything appears to work fine.

This is what i've changed the variable regex to (-)?\B\$([\w\s\-.]+), which so far so good ๐Ÿคท๐Ÿผ . There are probably things I haven't considered but it allows me to do this :)

      <Box
        as="div"
        backgroundColor="$Background Subtle"
        padding={{xsmall: '$Macro Small', large: '21px'}}
      />

Alternatives Considered

Another thing I could do is remap our tokens to something RS expects and hide that from consumers. It's a bit ham-handed but would probably work.

Additional Context

Existing components already use these strings so it'd be a massive change to completely overhaul how we use tokens.

Usage with the Recipe API from vanilla-extract

First of all thanks a lot for the library, awesome solution!

Description

After doing the changes to rainbow-sprinkles I wanted to use with the recipes API but I get this error:

Type 'RuntimeFnReturn' is not assignable to type 'RecipeStyleRule | undefined'.

I already added the variables correctly but still ...

Expected Behaviour

Able to create recipes without any errors.

Actual Behaviour

Getting error on the recipe API

Affected Version

^0.12.1

FYI - Error logs in assignClasses refers to Homebase

Noticed a few logs reference the Homebase design system, I wonder if it makes more sense for them to be prefixed with [Rainbow Sprinkles] instead:

Property 'children' is incompatible with index signature TS Error

Description

I'm not sure if this is a bug or not but figured I'd post an issue here. I'm running into a TS error when trying to create a Button component from Box. It only seems to happen if I add colorProperties to the createRainbowSprinkles function. You can see the CodeSandbox here: https://codesandbox.io/s/musing-antonelli-nh703c?file=/components/Box.css.ts:2421-2464

Expected Behaviour

I should be able to add colorProperties to the createRainbowSprinkles function.

Actual Behaviour

The TS error is Property 'children' is incompatible with index signature. You can see that on Button: https://codesandbox.io/s/musing-antonelli-nh703c?file=/components/Button.tsx

Screenshot 2023-02-07 at 14 49 10

Affected Version

0.15.1

Steps to Reproduce

I've shared the CodeSandbox. You can remove the TS error by commenting out this line: https://codesandbox.io/s/musing-antonelli-nh703c?file=/components/Box.css.ts:2755-2773

Checklist

No inline style should be returned when matching a static prop/value combination

Description

When defining a property in both dynamicProperties and staticProperties

export const properties = createRainbowSprinkles({
  dynamicProperties: {
    display: true,
  },
  staticProperties: {
    display: ['flex'],
  },
});

export const rainbowSprinkles(properties);

Although we can expect the property to work with both static and arbitrary values, it should only return inline style assignments when the value does not match those defined in staticProperties.

rainbowSprinkles({display: 'flex'}); // matches the staticProperties

Expected Behaviour

As described in the documentation, no inline style should be returned when matching a static prop/value combination.

The runtime portion of Rainbow Sprinkles will defer to the CSS classes created by staticProperties and not apply any inline style assignments.

{
  className: 'dynamicAtoms_display-flex-base__16s97g76g',
  style: {},
  otherProps: {}
}

Actual Behaviour

{
  className: 'dynamicAtoms_display-flex-base__16s97g76g',
  style: { '--display-base__16s97g73k': 'flex' },
  otherProps: {}
}

Affected Version

0.12.0

Checklist

๐Ÿ› assignInlineVars errors on null propValue

Description

When passing null as a propValue to one of the props configured to be a system prop, assignInlineVars errors here: https://github.com/wayfair/rainbow-sprinkles/blob/main/packages/rainbow-sprinkles/src/assignInlineVars.ts#L34

Expected Behaviour

null is silently ignored / omitted from the logic within assignInlineVars

Actual Behaviour

Cannot convert null or undefined to an object

Affected Version

0.9.3

Steps to Reproduce

Codesandbox: https://codesandbox.io/s/bug-null-values-6fl8uf?file=/pages/index.tsx

  1. Configure Box component
  2. Pass null to one of the configured system props
  3. See error

Checklist

FYI: Below link in checklist refers to the wayfair-incubator/oss-template repo, probably need to update the issue templates ๐Ÿ™‚

Ability to map dynamic properties values

Problem Statement

Hello, first of all I would like to thank for creating such amazing library!
I am not sure if such feature already exists, if not maybe it would be nice to have it.

You can define dynamic properties via defineProperties. However, the values for css variable are passed as-is. It would be nice if you could intercept this value and somehow change it. For example you may want to convert px to rem before setting final value

Proposed Solution

It is a rough suggestion to demonstrate the idea:

import { rem } from 'polished'
import { createRainbowSprinkles, defineProperties } from 'rainbow-sprinkles'

const layoutProperties = defineProperties({
    dynamicProperties: {
        width: value => (typeof value === 'number' ? rem(value) : value),
    },
    shorthands: {},
})

Technically I can use rem in react component, but having such convertions in style definitions is pretty handy. Also, the consumer do not need to import polished and rem approach is enforced by this approach.

styleq

Problem Statement

Generation of inline styles and classes during runtime could always be faster.

Proposed Solution

styleq is a library for merging CSS classes and inline styles focused on performance and memoization. Adding this to the runtime portion of the library could be beneficial.

Might be worthwhile to do a quick pass at integrating it and seeing if it improves performance.

Outline offset doesn't support string values

Description

While working with rainbow-sprinkles, I noticed outlineOffset is set to a number. That doesn't seem to render in browsers. It looks like the offset prop should take a standard length value. See the MDN docs here: https://developer.mozilla.org/en-US/docs/Web/CSS/outline-offset

Expected Behaviour

outlineOffset renders the properly set offset.

Actual Behaviour

outlineOffset value is ignored.

Affected Version

0.16.0

Steps to Reproduce

  1. Add outlineOffset: true to the dynamic properties.
  2. Try to use a px or rem value within Box.

Checklist

staticProperties does not apply styles

Description

Defining a property in staticProperties does not apply styles. For example,

const vars = {
  cursor: {
    pointer: "pointer",
  },
}

const responsiveProperties = defineProperties({
  staticProperties: {
    cursor: vars.cursor,
  },
})

Adding this, component that uses this:

import { rainbowSprinkles } from "../sprinkles.css"

export const container = rainbowSprinkles({
  cursor: "pointer",
})

will no longer have cursor: pointer work properly. If cursor property is removed from the staticProperties, it works.

Skip $-prefixing of staticProperty keys if they already begin with $

Problem Statement

I'd like to be able to share style variables more seamlessly.

export const space = {
  a: '1rem',
  b: '1.5rem',
  ...
} as const;

const foo = defineProperties({
  staticProperties: { margin: space },
});
// this uses the $ prefix on the key
<Box margin="$b"></Box>

// this uses the key directly as it pipes the value into an SVG's height and width
<Icon type="warning" size="b" />

// Or really any instance where we're dealing with the space object directly

Proposed Solution

In ascending order of safety:

  • skip prefixing CSS tokens if they start with $
  • add a config option to skip prefixing in general
  • add a config option, but only skip if the key starts with $

Alternatives Considered

Using a string template type to prefix keys locally.
I really don't like that type assertion though.

type Props = {
  size: `$${keyof typeof space}`;
}
...
const size = props.size.slice(1) as keyof typeof space;

Allow property values to be style objects

Problem Statement

Rainbow Sprinkles currently doesn't accept style objects as values when defining dynamicProperties.

This could be useful when using complex CSS properties like transform, which lets you rotate, scale, skew, or translate an element.

The only way at the moment to rotate or translate an element with Rainbow Sprinkles is to define the transform property with dynamic values as follows:

const properties = defineProperties({
  dynamicProperties: {
    transform: true,
  },
});

const rainbowSprinkles(properties);

Which forces you to dynamically construct the full transformation value, when only the length value could be provided

rainbowSprinkles({
  transform: `translateX(${length})` 
});

This also means you have to manually handle in JS things like rtl direction, while this could be automated ๐Ÿ˜ž

rainbowSprinkles({
  transform: `translateX(calc(${length} * ${transformDirection}))` 
});

Proposed Solution

As with regular Sprinkles properties, it would be great if the values could be entire style objects. This would make for even more powerful classes.

const properties = defineProperties({
  dynamicProperties: {
    translateX: {
      transform: `translateX(${true})`, // true being the placeholder for the dynamic value
      selectors: {
        '[dir="rtl"] &': {
          transform: `translateX(${calc.negate(true)})`,
        }
      }
    },
  }
});

Which would automatically produce the following classes

.rainbowSprinkles_translateX__16s97g72c {
  transform: translateX(var(--translateX__16s97g728));
}

[dir="rtl"] .rainbowSprinkles_translateX__16s97g72c {
  transform: translateX(calc(var(--translateX__16s97g728)) * -1)),
}

Support creating sprinkles without conditions

Problem Statement

Rainbow Sprinkles requires that conditions be provided in the initial configuration. This prevents the ability to produce Rainbow Sprinkles without any conditions, which can be useful for values and properties that don't need media queries or support checks.

Proposed Solution

Make conditions and optional field.

Expose class names and vars

Problem Statement

Hello, rainbow sprinkles usually used to define system styles, for example controlling width/height, paddings, margins etc. It could serve as a single source for such properties. However, there is no way do get class names and vars from rainbow sprinkles and reuse them.

Proposed Solution

Expose class names and vars, something like that:

import { assignVars } from '@vanilla-extract/css'
import { recipe } from '@vanilla-extract/recipes'
import { defineProperties, createRainbowSprinkles } from 'rainbow-sprinkles'

const vars = {
    space: {
        none: '0',
        small: '4px',
        medium: '8px',
        large: '16px',
    },
}

const responsiveProperties = defineProperties({
    dynamicProperties: {
        width: vars.space,
        height: vars.space,
    },
})

export const rainbowSprinkles = createRainbowSprinkles(responsiveProperties)

export const icon = recipe({
    base: [rainbowSprinkles.classNames.width],
    variants: {
        size: {
            small: {
                vars: assignVars(rainbowSprinkles.vars, { width: '$small', height: '$small' }),
            },
            superBig: {
                vars: assignVars(rainbowSprinkles.vars, { width: '30px', height: '30px' }),
            },
        },
    },
})

This is a rough implementation idea, probably you will need to have access to static properties as well

Getting started examples do not work

  • First, the code sandbox does not work
    image
  • Second, there's some missing code in the example
export const rainbowSprinkles(responsiveProperties)

should be

export const rainbowSprinkles = createRainbowSprinkles(responsiveProperties)
  • Finally, even after fixing that above line, the example code does not work due to TS errors
TS2345: Argument of type 'ReturnConditionalStatic<{ display: ("flex" | "block" | "inline-block" | "inline-flex")[]; }, { mobile: {}; tablet: { '@media': string; }; desktop: { '@media': string; }; }> & ReturnConditionalDynamic<...> & ReturnShorthands<...>' is not assignable to parameter of type 'DefinePropertiesReturn'.
Types of property 'config' are incompatible.
Type '{ display: { values: Values<("flex" | "block" | "inline-block" | "inline-flex")[], ConditionalMap<{ mobile: {}; tablet: { '@media': string; }; desktop: { '@media': string; }; }>>; staticScale: ("flex" | ... 2 more ... | "inline-flex")[]; name: "display"; }; } & { ...; } & { ...; }' is not assignable to type 'SprinkleProperties'.
Property 'margin' is incompatible with index signature.
Type '{ dynamic: ConditionalMap<{ mobile: {}; tablet: { '@media': string; }; desktop: { '@media': string; }; }>; dynamicScale: { none: number; small: string; medium: string; large: string; }; name: "margin"; vars: ConditionalMap<...>; }' is not assignable to type 'DynamicProperty | StaticProperty | StaticPropertyArray | StaticDynamicPropertyArray | ... 6 more ... | ShorthandProperty'.
Type '{ dynamic: ConditionalMap<{ mobile: {}; tablet: { '@media': string; }; desktop: { '@media': string; }; }>; dynamicScale: { none: number; small: string; medium: string; large: string; }; name: "margin"; vars: ConditionalMap<...>; }' is missing the following properties from type 'StaticDynamicConditionalProperty': values, staticScale

My package.json:

{
  "name": "remix-style-sandbox-c2ed",
  "private": true,
  "sideEffects": false,
  "scripts": {
    "build": "run-s build:*",
    "build:remix": "remix build",
    "dev": "run-p dev:*",
    "dev:remix": "cross-env NODE_ENV=development binode --require ./mocks -- @remix-run/dev:remix dev",
    "format": "prettier --write .",
    "lint": "eslint --cache --cache-location ./node_modules/.cache/eslint .",
    "setup": "prisma generate && prisma migrate deploy && prisma db seed",
    "start": "remix-serve build",
    "start:mocks": "binode --require ./mocks -- @remix-run/serve:remix-serve build",
    "test": "vitest",
    "test:e2e:dev": "start-server-and-test dev http://localhost:3000 \"npx cypress open\"",
    "pretest:e2e:run": "npm run build",
    "test:e2e:run": "cross-env PORT=8811 start-server-and-test start:mocks http://localhost:8811 \"npx cypress run\"",
    "typecheck": "tsc && tsc -p cypress",
    "validate": "run-p \"test -- --run\" lint typecheck test:e2e:run"
  },
  "prettier": {},
  "eslintIgnore": [
    "/node_modules",
    "/build",
    "/public/build"
  ],
  "dependencies": {
    "@prisma/client": "^4.9.0",
    "@remix-run/css-bundle": "^1.12.0",
    "@remix-run/node": "^1.12.0",
    "@remix-run/react": "^1.12.0",
    "@remix-run/serve": "^1.12.0",
    "@remix-run/server-runtime": "^1.12.0",
    "@vanilla-extract/sprinkles": "^1.5.1",
    "bcryptjs": "^2.4.3",
    "isbot": "^3.6.5",
    "lodash.merge": "^4.6.2",
    "rainbow-sprinkles": "^0.15.2",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "tiny-invariant": "^1.3.1"
  },
  "devDependencies": {
    "@faker-js/faker": "^7.6.0",
    "@remix-run/dev": "^1.12.0",
    "@remix-run/eslint-config": "^1.12.0",
    "@testing-library/cypress": "^8.0.7",
    "@testing-library/dom": "^8.20.0",
    "@testing-library/jest-dom": "^5.16.5",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^14.4.3",
    "@types/bcryptjs": "^2.4.2",
    "@types/eslint": "^8.4.10",
    "@types/lodash.merge": "^4.6.7",
    "@types/node": "^18.11.18",
    "@types/react": "^18.0.26",
    "@types/react-dom": "^18.0.10",
    "@vanilla-extract/css": "^1.9.5",
    "@vitejs/plugin-react": "^3.0.1",
    "@vitest/coverage-c8": "^0.27.2",
    "autoprefixer": "^10.4.13",
    "binode": "^1.0.5",
    "c8": "^7.12.0",
    "cookie": "^0.5.0",
    "cross-env": "^7.0.3",
    "cypress": "^10.11.0",
    "eslint": "^8.32.0",
    "eslint-config-prettier": "^8.6.0",
    "eslint-plugin-cypress": "^2.12.1",
    "happy-dom": "^8.1.4",
    "msw": "^0.49.2",
    "npm-run-all": "^4.1.5",
    "postcss": "^8.4.21",
    "prettier": "2.8.3",
    "prisma": "^4.9.0",
    "start-server-and-test": "^1.15.2",
    "ts-node": "^10.9.1",
    "tsconfig-paths": "^4.1.2",
    "typescript": "^4.9.4",
    "vite": "^4.0.4",
    "vite-tsconfig-paths": "^3.6.0",
    "vitest": "^0.27.2"
  },
  "engines": {
    "node": ">=14"
  },
  "prisma": {
    "seed": "ts-node --require tsconfig-paths/register prisma/seed.ts"
  }
}

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency @vanilla-extract/jest-transform to v1.1.4
  • fix(deps): update dependency @preconstruct/cli to v2.8.3
  • fix(deps): update dependency ts-jest to v29.1.2
  • chore(deps): update dependency @vanilla-extract/css to v1.14.2
  • chore(deps): update dependency @vanilla-extract/dynamic to v2.1.0
  • chore(deps): update pnpm to v8.15.7
  • chore(deps): update pnpm/action-setup action to v2.4.0
  • fix(deps): update dependency @changesets/cli to v2.27.1
  • fix(deps): update dependency prettier to v3.2.5
  • fix(deps): update dependency typescript to v4.9.5
  • chore(deps): update pnpm to v9
  • chore(deps): update pnpm/action-setup action to v3
  • fix(deps): update dependency typescript to v5
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/release.yml
  • pnpm/action-setup v2.2.4
  • changesets/action v1
.github/workflows/snapshot.yml
  • seek-oss/changesets-snapshot v0
.github/workflows/validate.yml
  • pnpm/action-setup v2.2.4
npm
package.json
  • @babel/core 7.23.7
  • @babel/preset-env 7.23.7
  • @babel/preset-typescript 7.23.3
  • @changesets/changelog-github ^0.5.0
  • @changesets/cli 2.26.1
  • @preconstruct/cli 2.8.2
  • @types/jest 29.5.11
  • @types/lodash.merge 4.6.7
  • @types/node 18.7.14
  • @types/react 18.2.46
  • @types/react-dom 18.2.18
  • concurrently 8.2.2
  • jest 29.7.0
  • prettier 3.1.1
  • react 18.2.0
  • react-dom 18.2.0
  • ts-jest 29.1.1
  • ts-node 10.9.1
  • tslib 2.4.0
  • typescript 4.8.4
  • @vanilla-extract/jest-transform 1.1.1
  • prettier-plugin-astro ^0.8.0
  • pnpm 8.13.1
packages/rainbow-sprinkles/package.json
  • @types/jest 29.0.0
  • @vanilla-extract/css 1.11.0
  • @vanilla-extract/dynamic 2.0.3
  • jest 29.7.0
  • @vanilla-extract/css ^1
  • @vanilla-extract/dynamic ^2
nvm
.nvmrc
  • node 16.20.0

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.