랭킹으로 돌아가기

styled-components/babel-plugin-styled-components

JavaScript

Improve the debugging experience and add server-side rendering support to styled-components

styled-componentsminificationbabelbabel-pluginssr
스타 성장
스타
1.1k
포크
139
주간 성장
이슈
37
5001k
2016년 10월2020년 1월2023년 4월2026년 7월
아티팩트npmnpm install babel-plugin-styled-components
README

babel-plugin-styled-components

This plugin is a highly recommended supplement to the base styled-components library, offering some useful features:

  • consistently hashed component classNames between environments (a must for server-side rendering)
  • better debugging through automatic annotation of your styled components based on their context in the file system, etc.
  • various types of minification for styles and the tagged template literals styled-components uses

Requirements

This plugin is tested against:

  • @babel/core ^7
  • styled-components >= 6 (earlier majors may still work but aren't exercised in CI)

Quick start

Install the plugin first:

npm install --save-dev babel-plugin-styled-components

Then add it to your babel configuration:

{
  "plugins": ["babel-plugin-styled-components"]
}

Options

Full option reference lives on the styled-components documentation site. A couple worth flagging here:

  • topLevelImportPaths (string[]): additional module specifiers whose styled export should be recognized alongside styled-components. Useful for libraries that re-export the styled-components API.
  • cssPropImportPath (string, default 'styled-components'): which package the css-prop transform should auto-import styled from when the file doesn't already have a styled import. Set to 'styled-components/native' for React Native targets.

Changelog

See Github Releases

Documentation

The documentation for this plugin lives on the styled-components website!

License

Licensed under the MIT License, Copyright © 2016-present Vladimir Danchenkov and Maximilian Stoiber.

See LICENSE.md for more information.

관련 저장소
styled-components/styled-components

Fast, expressive styling for React. Server components, client components, streaming SSR, React Native—one API.

TypeScriptnpmMIT Licensereactcss-in-js
styled-components.com
41.1k2.6k
react-boilerplate/react-boilerplate

🔥 A highly scalable, offline-first foundation with the best developer experience and a focus on performance and best practices.

JavaScriptnpmMIT Licensereactreact-boilerplate
reactboilerplate.com
29.5k6k
withspectrum/spectrum

Simple, powerful online communities.

JavaScriptnpmBSD 3-Clause "New" or "Revised" Licensereactjsnodejs
spectrum.chat
10.8k1.2k
astrit/css.gg

700+ Pure CSS, SVG & Figma UI Icons, 6000+ glyphs, patterns, colors and layouts.

JavaScriptnpmOthercssicons
css.gg
10k496
bchiang7/v4

Fourth iteration of my personal website built with Gatsby

JavaScriptnpmMIT Licensestyled-componentsgatsbyjs
v4.brittanychiang.com
8.3k4.2k
ben-rogerson/twin.macro

🦹‍♂️ Twin blends the magic of Tailwind with the flexibility of css-in-js (emotion, styled-components, solid-styled-components, stitches and goober) at build time.

TypeScriptnpmMIT Licensetailwindtailwindcss
8k178
rebassjs/rebass

:atom_symbol: React primitive UI components built with styled-system.

JavaScriptnpmMIT Licensejavascriptreact
rebassjs.org
7.9k634
styled-system/styled-system

⬢ Style props for rapid UI development

JavaScriptnpmMIT Licensereactcss-in-js
styled-system.com
7.9k495
styled-components/polished

A lightweight toolset for writing styles in JavaScript ✨

JavaScriptnpmMIT Licensecss-in-jsstyled-components
polished.js.org
7.7k214
react95-io/React95

🌈🕹 Windows 95 style UI component library for React

TypeScriptnpmMIT Licensecomponent-libraryreact
react95.io
7.3k213
Evavic44/portfolio-ideas

A curation of awesome portfolio website ideas for developers and designers to draw inspiration from. Raise a pull request to add more. 💜

MarkdownMIT Licensedesignersdeveloper-portfolio
portfolio-ideas.vercel.app/portfolio.html
6.2k944
gluestack/gluestack-ui

React & React Native Components & Patterns (copy-paste components & patterns crafted with Tailwind CSS (NativeWind))

TypeScriptnpmreactui
gluestack.io
5.2k230