@20i/react-css-classes
TypeScript icon, indicating that this package has built-in type declarations

1.2.4 • Public • Published

@20i/react-css-classes

Using a MUI theme, provides a lot of CSS classes to make writing React components quicker!

Peer Deps

"@material-ui/core": "^4.9.0"
"@material-ui/styles": "^4.9.0"

Init

// filename: style.ts

import { createMuiTheme } from "@material-ui/core/styles"
import { useClasses } from "@20i/react-css-classes"

export const theme = createMuiTheme({
    // typography,
    // palette,
    // breakpoints,
    // spacing,
    // overrides,
    // props
})

// export the hook!
export const useReactCSSClasses = useClasses(theme)

Usage in a react component

import { useReactCSSClasses } from "style"
import React from "react"

const MyReactComponent = () => {
    const rc = useReactCSSClasses()

    // use whatever classes you want. There's a ton!!
    const className = rc.bgPrimaryDark

    return (
        <div className={className}>
            This is my component
        </div>
    )
}

CSS Classes

There's a lot of helper CSS classes. You can view them by category.

Animation Border Color Flex Handy MarginPadding Opacity Positional Shadow TextAlignment Transform

/@20i/react-css-classes/

    Package Sidebar

    Install

    npm i @20i/react-css-classes

    Weekly Downloads

    12

    Version

    1.2.4

    License

    ISC

    Unpacked Size

    118 kB

    Total Files

    53

    Last publish

    Collaborators

    • wilblack
    • trevordilley
    • wasredacted
    • james-20i
    • 20i-npm-service
    • valery20i
    • hiddn
    • keeto-20i
    • gelfer
    • tony20i
    • mearl20i
    • mook-20i
    • orianna-20i