system-props
Advanced tools
Weekly downloads
Changelog
Readme
Responsive, theme-based style props for building design systems with React. https://system-props.com
yarn add system-props
Functions almost identically to styled-system, but adds the following features:
border
, margin
, padding
, and box-shadow
$
See the example project in this repo for a more complete example.
import { createSystem, color, space } from 'system-props';
import styled, { ThemeProvider } from 'styled-components';
const theme = {
space: ['0px', '4px', '8px', '16px', '32px'],
colors: {
blue100: 'lightblue',
blue200: 'blue',
//...etc
},
};
const system = createSystem({
strict, // default: false
pseudoSelectors, // default: { _hover: '&:hover', ...etc }
});
const Box = styled.div(system({ ...color, ...space }));
const App = () => {
return (
<ThemeProvider theme={theme}>
<Box
bg="$blue500"
margin="$1 $2 $3 $4"
border="1px solid $blue200"
borderBottom={(theme) => `3px dotted ${theme.colors.blue200}`}
_hover={{
bg: '$blue700',
}}
/>
</ThemeProvider>
);
};
Many of the concepts here come from so many great, existing open-source projects, and they deserve a shout-out!
FAQs
Inspired by styled-system, a responsive, theme-based style props for building design systems with React.
The npm package system-props receives a total of 556 weekly downloads. As such, system-props popularity was classified as not popular.
We found that system-props demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.