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

@linaria/core

Package Overview
Dependencies
Maintainers
4
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@linaria/core

Blazing fast zero-runtime CSS in JS library

  • 3.0.0-beta.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
242K
increased by6.24%
Maintainers
4
Weekly downloads
 
Created

What is @linaria/core?

@linaria/core is a zero-runtime CSS-in-JS library for React that allows you to write CSS styles with JavaScript and extract them to CSS files at build time. This approach ensures that your styles are not included in the JavaScript bundle, leading to better performance and smaller bundle sizes.

What are @linaria/core's main functionalities?

Styled Components

Allows you to create styled components using tagged template literals. The styles are written in a CSS-like syntax and are scoped to the component.

const Button = styled.button`\n  background: palevioletred;\n  border-radius: 3px;\n  border: none;\n  color: white;\n  padding: 0.5em 1em;\n  font-size: 1em;\n`;

CSS Variables

Supports the use of JavaScript variables within your CSS, enabling dynamic styling based on your application's state or theme.

const theme = {\n  primaryColor: 'palevioletred',\n};\nconst Title = styled.h1`\n  color: ${theme.primaryColor};\n`;

Keyframes

Allows you to define CSS animations using the keyframes helper, which can then be applied to styled components.

import { keyframes } from '@linaria/core';\nconst fadeIn = keyframes`\n  from { opacity: 0; }\n  to { opacity: 1; }\n`;

Global Styles

Enables you to define global styles that apply to the entire application, not just individual components.

import { css } from '@linaria/core';\ncss`\n  :global() {\n    body {\n      margin: 0;\n      padding: 0;\n      font-family: sans-serif;\n    }\n  }\n`;

Other packages similar to @linaria/core

Keywords

FAQs

Package last updated on 11 Apr 2021

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