Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@styled-system/css

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@styled-system/css

Styled System for your `css` prop

  • 2.0.3
  • npm
  • Socket score

Version published
Weekly downloads
337K
decreased by-40.61%
Maintainers
1
Weekly downloads
 
Created

What is @styled-system/css?

@styled-system/css is a utility function for creating style objects based on a theme. It allows you to use a JavaScript object to define styles, which can then be applied to components. This package is part of the Styled System family and is designed to work seamlessly with other Styled System utilities.

What are @styled-system/css's main functionalities?

Theming

Theming allows you to define a set of design tokens (e.g., colors, spacing, typography) that can be referenced throughout your application. This ensures consistency and makes it easy to update the design system.

{
  "theme": {
    "colors": {
      "primary": "#07c",
      "secondary": "#05a"
    }
  },
  "styles": {
    "button": {
      "backgroundColor": "primary",
      "color": "white",
      "padding": "8px 16px",
      "borderRadius": "4px"
    }
  }
}

Responsive Styles

Responsive styles allow you to define different styles for different screen sizes using an array syntax. This makes it easy to create responsive designs without writing media queries.

{
  "styles": {
    "button": {
      "padding": ["8px 16px", "12px 24px", "16px 32px"]
    }
  }
}

Variant Styles

Variant styles allow you to define reusable style objects that can be applied to components. This is useful for creating consistent styles for different variants of a component (e.g., primary and secondary buttons).

{
  "theme": {
    "buttons": {
      "primary": {
        "backgroundColor": "primary",
        "color": "white"
      },
      "secondary": {
        "backgroundColor": "secondary",
        "color": "white"
      }
    }
  },
  "styles": {
    "button": {
      "variant": "buttons.primary"
    }
  }
}

Other packages similar to @styled-system/css

FAQs

Package last updated on 24 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc