New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

facepaint

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

facepaint

Responsive style values for css-in-js.

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created

What is facepaint?

Facepaint is a utility for writing responsive style rules in JavaScript. It allows you to define breakpoints and apply styles conditionally based on those breakpoints, making it easier to manage responsive design in a JavaScript-centric workflow.

What are facepaint's main functionalities?

Define Breakpoints

This feature allows you to define custom breakpoints for your responsive design. The breakpoints are specified as an array of media query strings.

const facepaint = require('facepaint');
const mq = facepaint([
  '@media(min-width: 420px)',
  '@media(min-width: 768px)',
  '@media(min-width: 1024px)'
]);

Apply Responsive Styles

This feature allows you to apply styles conditionally based on the defined breakpoints. The styles are specified as arrays, where each element corresponds to a breakpoint.

const styles = mq({
  color: ['red', 'green', 'blue', 'purple'],
  fontSize: ['12px', '14px', '16px', '18px']
});

Combine with CSS-in-JS Libraries

Facepaint can be easily combined with CSS-in-JS libraries like Emotion. This allows you to write responsive styles in a more modular and maintainable way.

import { css } from '@emotion/react';
const mq = facepaint([
  '@media(min-width: 420px)',
  '@media(min-width: 768px)',
  '@media(min-width: 1024px)'
]);
const style = css(mq({
  color: ['red', 'green', 'blue', 'purple'],
  fontSize: ['12px', '14px', '16px', '18px']
}));

Other packages similar to facepaint

Keywords

FAQs

Package last updated on 13 Feb 2018

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