Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

buryem

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buryem

got style conflicts? bury 'em!

latest
Source
npmnpm
Version
1.3.0
Version published
Maintainers
2
Created
Source

buryem

Got style conflicts? Bury 'em!

Based on Barium by Yuanyan Cao.

Features

  • Keep Simple: No cascading, No nesting
  • No Conflict: Selectors are generated and are unique
  • Better CSS Support: Pseudo Classes, Media Queries
  • Automatically Add things: Vendor Prefixes, Default "px" unit to numeric values where needed

Installation

npm i buryem --save

Developing

To build locally, run:

npm install --ignore-scripts
npm run build

Usage

import buryem from 'buryem';


const animations = buryem.createAnimations({
	blurh: {
		"33%": {
			transform: "translateX(2px)"
		},
		"66%": {
			transform: "translateX(-2px)"
		},
		"100%": {
			transform: "translateX(0px)"
		}			
	}
}, 'optional-readable-namespace');

const styles = buryem.create({
  btn: {
    display: 'inline-block',
    color: '#000',
    padding: '6px 12px',
    marginBottom: '0',
    fontSize: '14px',
    fontWeight: 'normal',
    lineHeight: '1.428571429',
    textAlign: 'center',
    whiteSpace: 'nowrap',
    verticalAlign: 'middle',
    cursor: 'pointer',
    backgroundImage: 'none',
    border: '1px solid transparent',
    borderRadius: '4px',
    userSelect: 'none',

    ':hover': {
      color: '#fff',
      animation: `${animations.blurh} .5s infinite`
    },
    // Try resizing the window!
    '@media (max-width: 500px)': {
      backgroundColor: '#5bc0de',
      borderColor: '#46b8da'
    }
  }
}, 'optional-readable-namespace');

const Example = (props) => (
	<div>
		<button className={styles.btn}>
			Click Me <span data-nah="nah">or nah</span>
		</button>
		<style>
			{/* if you need to reach into the children you can do this */}
			{`
				.${styles.btn} [data-nah="nah"] {
					color: #f0f;
				}
			`}
		</style>
	</div>
);

Pass an object as a 3rd argument to any of these methods and they will add or append the styles to be injected to it as a __cssText property.

Keywords

react

FAQs

Package last updated on 12 Oct 2016

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