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

@jasonleibowitz/merge-styles

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jasonleibowitz/merge-styles

Simple utility to merge classnames for theming

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@jasonleibowitz/merge-styles

Merge Styles

Build Status Coverage Status

Simple JS Utility to merge multiple classnames together. I use this in my react apps to make components easily themeable via a theme prop.

Example Usage

import React from 'react';
import mergeStyles from 'merge-styles';
import styles from './styles.css'

export default function Component({ theme }) {
  const mergedStyles = mergeStyles({
    container: styles.container,
    text: null,
    title: styles.title,
  })

  return (
    <div className={mergedStyles.container}>
      <h1 className={mergedStyles.title}>Hello World</h1>
      <p className={mergedStyles.text}>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec eget felis non quam bibendum vestibulum et et libero. Morbi in diam nec ex euismod consectetur. Phasellus elementum, dolor vitae ullamcorper vulputate, nunc turpis dictum lectus, non rhoncus magna velit vel nulla. Quisque tincidunt vehicula turpis a auctor. Fusce quis tempor risus, vel faucibus dolor. Pellentesque non ultricies nisl, non auctor neque. Nunc vulputate varius ipsum et lobortis.</p>
    </div>
  );
}

FAQs

Package last updated on 30 May 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