npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

emotion-flex

v2.0.0

Published

Fully customizable responsive flexbox grid system, made with emotion

Downloads

122

Readme

emotion-flex

Build Status Coverage Status NPM MIT License code style: prettier

Fully customizable responsive grid system build with emotion, based on Bootstrap.

Install

⚠ WARNING For emotion 10 use v1.x.x of emotion-flex

npm i --save emotion-flex @emotion/react @emotion/styled

# or

yarn add emotion-flex @emotion/react @emotion/styled

Usage

Bootstrap is developed mobile first, a strategy in which we optimize code for mobile devices first and then scale up components as necessary using CSS media queries. To ensure proper rendering and touch zooming for all devices, add the responsive viewport meta tag to your <head>. from Bootstrap docs

<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

Make sure you reset box-sizing somewhere in global styles:

*,
*::before,
*::after {
  box-sizing: inherit;
}

html {
  box-sizing: border-box;
}
import React, { Component } from 'react'

import { Container, Row, Col } from 'emotion-flex'

class Example extends Component {
  render () {
    return (
      <Container>
        <Row>
          <Col xs={12} sm={6} md={4} lg={3}>1st column</Col>
          <Col xs={12} sm={6} md={4} lg={3}>2nd column</Col>
        </Row>
      </Container>
    )
  }
}

API

Container

| props | type | description | | ----- | ------- | ----------------------------------------------------------- | | fluid | boolean | Equivalent to Bootstrap's container and container-fluid |

Row

| props | type | description | | --------- | ------- | ----------------------------- | | noGutters | boolean | Remove Row's negative margins |

Col

| props | type | description | | --------- | --------------------------- | ------------------------------------------------------ | | noGutters | boolean | Removes the padding around Column | | xsOffset | number (2-11) | The number of columns to offset on extra small devices | | xsOrder | number or "first" or "last" | Sets the order on extra small devices | | xs | number (1-12) | The number of columns to span on extra small devices | | smOffset | number (2-11) | The number of columns to offset on small devices | | smOrder | number or "first" or "last" | Sets the order on small devices | | sm | number (1-12) | The number of columns to span on small devices | | mdOffset | number (2-11) | The number of columns to offset on medium devices | | mdOrder | number or "first" or "last" | Sets the order on medium devices | | md | number (1-12) | The number of columns to span on medium devices | | lgOffset | number (2-11) | The number of columns to offset on large devices | | lgOrder | number or "first" or "last" | Sets the order on large devices | | lg | number (1-12) | The number of columns to span on large devices | | xlOffset | number (2-11) | The number of columns to offset on extra large devices | | xlOrder | number or "first" or "last" | Sets the order on extra large devices | | xl | number (1-12) | The number of columns to span on extra large devices |

Theming

import React, { Component } from 'react'
import { ThemeProvider } from '@emotion/react'

import { Container, Row, Col } from 'emotion-flex'

const customTheme = {
  breakpoints: {
    sm: 600,
    md: 960,
    lg: 1280,
    xl: 1920,
  },
  maxWidths: {
    sm: 576,
    md: 768,
    lg: 992,
    xl: 1200,
  },
  gutters: 16
};

class Example extends Component {
  render () {
    return (
      <ThemeProvider theme={customTheme}>
        <Container>
          <Row>
            <Col xs={12} sm={6} md={4} lg={3}>1st column</Col>
            <Col xs={12} sm={6} md={4} lg={3}>2nd column</Col>
          </Row>
        </Container>
      </ThemeProvider>
    )
  }
}

Default theme:

{
  breakpoints: {
    sm: 576,
    md: 768,
    lg: 992,
    xl: 1200,
  },
  maxWidths: {
    sm: 540,
    md: 720,
    lg: 960,
    xl: 1140,
  },
  gutters: 15,
}

Other projects

License

MIT © janczizikow