0.29.0 • Published 1 month ago

@webformula/material v0.29.0

Weekly downloads
-
License
ISC
Repository
github
Last release
1 month ago

@webfurmula/material

Material design v3 web components. Performant, light-weight, full features, optimized for multiple devices. Webformula material docs

Highlights

  • ⚡ Lightweight - 79KB compressed
  • ⚡ Performant - Uses native web components
  • ⚡ 0 dependencies
  • ⚡ Optimized for all screens and devices
  • ⚡ Simple to use
  • ⚡ Style and color control

About

Material design V3 web components that are full featured, performant and simple to use. These components are robust and work with all modern browsers. Built with mobile in mind, adapting to small screens and touch inputs. Our goal is reduce the complexity and increase usability.

Table of Contents

Getting started

Installation

npm install @webformula/material

Importing components

// import everything
import '@webformula/material';

// importing individual components. Use to optimize file sizes
import '@webformula/material/components/badge';
import '@webformula/material/components/bottom-app-bar';
import '@webformula/material/components/bottom-sheet';
import '@webformula/material/components/button';
import '@webformula/material/components/card';
import '@webformula/material/components/checkbox';
import '@webformula/material/components/chip';
import '@webformula/material/components/date-picker';
import '@webformula/material/components/dialog';
import '@webformula/material/components/fab';
import '@webformula/material/components/form';
import '@webformula/material/components/icon';
import '@webformula/material/components/list';
import '@webformula/material/components/menu';
import '@webformula/material/components/navigation';
import '@webformula/material/components/progress-circular';
import '@webformula/material/components/progress-linear';
import '@webformula/material/components/radio';
import '@webformula/material/components/scrim';
import '@webformula/material/components/search';
import '@webformula/material/components/segmented-button';
import '@webformula/material/components/select';
import '@webformula/material/components/side-sheet';
import '@webformula/material/components/slider';
import '@webformula/material/components/snackbar';
import '@webformula/material/components/switch';
import '@webformula/material/components/tab';
import '@webformula/material/components/textfield';
import '@webformula/material/components/time-picker';
import '@webformula/material/components/tooltip';
import '@webformula/material/components/top-app-bar';

// importing services.These are also available on 'window'
import {
  wfcDate,
  wfcDevice,
  wfcDialog,
  wfcUtil,
  wfcSnackbar
} from '@webformula/material/services';

// importing individual services
import util from  '@webformula/material/services/util';
<!-- import in index.html - NOT recommended -->
<script src="https://cdn.jsdelivr.net/gh/webformula/material@latest/dist/material.js"></script>

Importing Styles

You may want to copy and serve theme.css in your app. This is where you configure you custom theme. If you want to use the default dark and light theme, then you can use the one in the repo.

/* theme.css should be loaded first */
  
/* import in app css */
@import('@webformula/materia.theme.css');
<!-- import in index.html -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/webformula/material@latest/dist/theme.css">

Font loading You can use google fonts to load custom fonts

theme.css should be the first file imported or loaded theme.css can be customized to update light and dark color schemes. If you use the one in the repo it will be the default schemes.

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
  href="https://fonts.googleapis.com/css2?family=Roboto+Flex:opsz,wght@8..144,300;8..144,400;8..144,500&display=swap"
  rel="stylesheet">

Icon loading Uses material icon font

For icons this uses Googles Material icon font. All component required icons are packed in with library. Only needed if using the wfc-icon component

<!--
  Load material icons via google fonts.
  All component required icons are packed in with library.
  Only needed if using the wfc-icon component
-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

Building theme

Theme css can be generated at build time.

build.js build script

import generate from '@webformula/material/themeGenerator';

// generate(input path, output path)
generate({
  coreColors: {
    // primary is the only required color
    primary: '#6750A4',

    // By default these generate from the primary
    // You can override them here
    secondary: '#625B71',
    tertiary: '#7D5260',
    neutral: '#67616f',
    neutralVariant: '#605666',
    error: '#B3261E'
  },

  // Specify custom colors to use in app
  customColors: [
    {
      name: 'customColor',
      color: '#5b7166'
    }
  ]
}, './colorTokens.css');
0.29.0

1 month ago

0.28.0

2 months ago

0.27.0

3 months ago

0.26.0

3 months ago

0.25.0

5 months ago

0.21.0

7 months ago

0.20.0

8 months ago

0.11.0

10 months ago

0.10.1

11 months ago

0.12.0

9 months ago

0.11.1

10 months ago

0.10.2

11 months ago

0.12.1

9 months ago

0.10.3

10 months ago

0.14.0

9 months ago

0.10.4

10 months ago

0.15.0

9 months ago

0.14.1

9 months ago

0.16.0

8 months ago

0.14.2

9 months ago

0.10.6

10 months ago

0.10.0

11 months ago

0.23.0

6 months ago

0.22.1

7 months ago

0.22.0

7 months ago

0.21.1

7 months ago

0.9.1

11 months ago

0.9.0

11 months ago

0.8.9

11 months ago

0.8.5

11 months ago

0.8.3

11 months ago

0.8.2

11 months ago

0.8.1

11 months ago

0.8.0

11 months ago

0.7.0

1 year ago

0.6.0

1 year ago

0.5.0

1 year ago

0.4.0

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago