Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@linaria/core
Advanced tools
@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.
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`;
styled-components is a popular CSS-in-JS library that allows you to write actual CSS to style your components. It provides a similar API to @linaria/core but includes runtime overhead, which can impact performance.
Emotion is a performant and flexible CSS-in-JS library. It offers both a styled-components-like API and a lower-level API for more control. Unlike @linaria/core, Emotion includes runtime styling, which can be less performant.
Zero-runtime CSS in JS library.
npm install @linaria/core @linaria/react @linaria/babel-preset @linaria/shaker
or
yarn add @linaria/core @linaria/react @linaria/babel-preset @linaria/shaker
FAQs
Blazing fast zero-runtime CSS in JS library
We found that @linaria/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.