GithubHelp home page GithubHelp logo

fupete / mui-italia Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pagopa/mui-italia

0.0 1.0 0.0 7.06 MB

Material-UI theme inspired by BootstrapItalia.

License: MIT License

JavaScript 1.25% TypeScript 98.75%

mui-italia's Introduction

MUI Italia

Material-UI theme inspired by Bootstrap Italia.

Installation

To add this package to your package.json run in your terminal:

// with npm
$ npm install @pagopa/mui-italia @mui/material @emotion/react @emotion/styled
// with yarn
$ yarn add @pagopa/mui-italia @mui/material @emotion/react @emotion/styled

Usage

/*
** MainApp.js
*/
[...]
/* MUI Core Components */
import { Button } from '@mui/material';
import { ThemeProvider } from "@mui/material";

/* MUI Italia theme */
import { theme } from "@pagopa/mui-italia";


function App() {
  return (
    <ThemeProvider theme={theme}>
      <div className="App">
        <Button variant="contained">Hello World</Button>
      </div>
    </ThemeProvider>
  );
}

export default App;

Then, use Material-UI as usual. The theme is just a "wrapper" which overrides the default params like: colors, font-family, padding size, etc etc. Try to avoid custom style, try to use all the standard library + this theme.

This package contain also a specific "color" named "Italia", with a "blu italia palette". To use this color in your component use:

[...]
import { italia } from "@pagopa/mui-italia";

<Box
  sx={{
    width: 100,
    height: 100,
    backgroundColor: italia[200],
    borderRadius: theme.spacing(3),
  }}
></Box>

CLI Commands

Here's an explanation of the commands you can find in the package.json:

  • prebuild: Executed automtically before the build command. It removes the dist folder to get a blank state.
  • build: It compiles the entire project using the relative tsconfig.json file. It also resolves all the alias contained in the configuration file.
  • lint: It checks the entire project to detect syntax errors or inefficient code, using the configuration set in the eslintrc.js file.
  • storybook: It launches a local Storybook application using 6006 port.
  • build-storybook: It outputs a static Storybook in the storybook-static folder
  • chromatic: It checks all the possible differences between snapshots using the Chromatic service. It also publishes an updated version of the Storybook-Chromatic library (see address below). This command is just available to the CI/CD environment because you have to specify the project token to run the command successfully. To get the token value in Chromatic: Manage โ†’ Configure โ†’ Setup Chromatic

Storybook

If you need to view all the styled and custom components available in this package, check out the (ongoing) MUI Italia Storybook (managed with Chromatic).

Contributions

Any critiques and suggestions are welcome. If you feel pretty confident, you can open a Pull Request

mui-italia's People

Contributors

dmnplb avatar dependabot[bot] avatar lorenzococciarelli avatar vito80ba avatar esignore avatar carminepo2 avatar pasqualedevita avatar ruggerocastagnola avatar loremedda avatar maurizioflauti avatar andreacimini90 avatar carladimatteo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.