🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@linaria/core

Package Overview
Dependencies
Maintainers
0
Versions
44
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

6.3.0
latest
Source
npm
Version published
Maintainers
0
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

css

FAQs

Package last updated on 16 Mar 2025

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