15.2.0 • Published 1 year ago

material-themeable v15.2.0

Weekly downloads
21
License
MIT
Repository
-
Last release
1 year ago

material-themeable

npm NPM npm GitHub last commit GitHub issues

An extension to angular material

Gives you the ability to add angular theming to any component. Also gives greater access to material theme colors, such as 'darker' and 'lighter'. If you are really brave you can even access the raw palette colors i.e. '50' - '900' and 'A100' - 'A700'.

Demo

coming soon

Installation

npm install material-themeable -P

In your styles.scss import the theme

@import "~material-themeable/theming";

Right after you include your angular theme, include material themeable

So from this

@include angular-material-theme($my-theme);

to this

@include angular-material-theme($my-theme);
@include material-themeable($my-theme);

if you have multiple themes available you will need to include material themeable just as you do the angular theme

body {
...
    @include angular-material-theme($my-theme);
    @include material-themeable($my-theme);
    
    &.dark {
      @include angular-material-theme($my-dark-theme);
      @include material-themeable($my-dark-theme);
    }
}

Usage

Add the matThemeable attribute to your HTML tag along with one or more of the Input attributes. Adding the matThemeable on it's own won't have any impact on the HTML element

HTML elements

<div matThemeable color="primary">test</div>

Angular Material Components

It's possible to extend standard angular material components

<mat-toolbar matThemeable color="primary" hue="lighter">
  <h1>Title</h1>
</mat-toolbar>

This will give a standard material tool bar, but using the themes primary light color

Inputs

InputDescriptionType
colorsets the background color and text color using a one of the themes palettesMatThemeablePalette
huemodifies the color using additional colors in the paletteMatThemeableHue
layoutsets a predefined layout, if used margin and padding are ignoredMatThemeableLayout
marginsets predefined margin, if used horizontalMargin and verticalMargin are ignoredMatThemeableSize
paddingsets predefined padding, if used horizontalPadding and verticalPadding are ignoredMatThemeableSize
horizontalMarginsets predefined margin-left and margin-rightMatThemeableSize
verticalMarginsets predefined margin-top and margin-bottomMatThemeableSize
horizontalPaddingsets predefined padding-left and padding-rightMatThemeableSize
verticalPaddingsets predefined padding-top and padding-bottomMatThemeableSize

Types

MatThemeableHue

Warning - using this option can very quickly lead to an incoherent design! If you do use this input it is recommended to only use the 'default', 'lighter' and 'darker'. This is especially true if your site has the ability to switch themes.

Don't say you weren't warned!!!

  • '50'
  • '100'
  • '200'
  • '300'
  • '400'
  • '500'
  • '600'
  • '700'
  • '800'
  • '900'
  • 'A100'
  • 'A200'
  • 'A400'
  • 'A700'
  • 'default'
  • 'lighter'
  • 'darker'

    MatThemeableLayout

  • 'small'

  • 'standard'
  • 'large'
  • 'very-large'

MatThemeablePalette

  • 'base'
  • 'primary'
  • 'accent'
  • 'warn'

    MatThemeableSize

  • 'none'

  • 'very-small'
  • 'small'
  • 'standard'
  • 'large'
  • 'very-large'
15.2.0

1 year ago

14.0.1

2 years ago

14.0.2

2 years ago

14.0.3

2 years ago

14.0.0

2 years ago

0.4.7-rc.0

2 years ago

0.4.7-rc.1

2 years ago

0.4.7

2 years ago

0.4.6-rc.0

2 years ago

0.4.6

3 years ago

0.4.5

3 years ago

0.4.4

4 years ago

0.4.4-alpha.1

4 years ago

0.4.3-beta-1

4 years ago

0.4.3

4 years ago

0.4.2

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago

0.0.1

4 years ago