Socket
Book a DemoInstallSign in
Socket

lemon-reset

Package Overview
Dependencies
Maintainers
7
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lemon-reset

Provides a React component with Meyer Reset styles for every element in Meyer Reset. For use with css-modules.

2.0.0
latest
Source
npmnpm
Version published
Weekly downloads
10
-37.5%
Maintainers
7
Weekly downloads
 
Created
Source

🍋 Lemon Reset

npm gzip size install size

A set of React components that provide Meyer Reset styles for use with CSS Modules.

For all the DOM tags used in Meyer Reset, Lemon Reset provides a React component with those reset styles, minimizing the effect of browser quirks. In a React world, we prefer components that are self-contained and not reliant on global styling.

Read more about the motivation behind Lemon Reset in our blog post!

Installation

yarn add lemon-reset

Usage

Use these components as a drop in replacement for your existing HTML tags!

import { P } from 'lemon-reset';

ReactDOM.render(<P>Hello World</P>, myContainer);

Wrap Lemon Reset components in your own custom components!

import { Span, Div } from 'lemon-reset';
import styles from './Container.css';

type Props = {
    display: 'inline' | 'inline-block' | 'block' | 'none',
};

const Container = ({ children, display }: Props) => {
    const Tag = display === 'inline' ? Span : Div;
    const classes = styles[`display--${display}`];

    return <Tag className={classes}>{children}</Tag>;
};

export default Container;

Pass in any props! If you need to pass in a ref, you'll need to pass it in as a tagRef:

<Span tagRef={(span) => console.log(span)}>This has a ref</Span>

Build

Our makefile assumes that you have virtualenv available globally, as we use a python environment for running pre-commit.

If you have virtualenv, simply run:

make build

Otherwise, you can do:

NODE_ENV=production yarn babel src --out-dir lib --copy-files

FAQs

Package last updated on 01 May 2024

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.