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

material-themeable

v15.2.0

Published

Angular Material extension

Downloads

51

Readme

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

| Input | Description | Type | |---|---|---| | color | sets the background color and text color using a one of the themes palettes | MatThemeablePalette | | hue | modifies the color using additional colors in the palette | MatThemeableHue | | layout | sets a predefined layout, if used margin and padding are ignored | MatThemeableLayout | | margin | sets predefined margin, if used horizontalMargin and verticalMargin are ignored | MatThemeableSize | | padding | sets predefined padding, if used horizontalPadding and verticalPadding are ignored | MatThemeableSize | | horizontalMargin | sets predefined margin-left and margin-right | MatThemeableSize | | verticalMargin | sets predefined margin-top and margin-bottom | MatThemeableSize | | horizontalPadding | sets predefined padding-left and padding-right | MatThemeableSize | | verticalPadding | sets predefined padding-top and padding-bottom | MatThemeableSize |

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'