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

pip-webui-themes

v2.1.0

Published

Non-visual core services for Pip.WebUI

Downloads

60

Readme

Color Themes

Pip.WebUI.Themes module contains a mechanism to define and dynamically switch color themes for both Angular Material and custom controls.

pipTheme service allows to change color themes in the application.

Register pipTheme module in angular module dependencies.

angular.module('myApp',[..., 'pipTheme']);

Use setCurrentTheme function for change current theme. Use initializeTheme function if you want use css classes for theme colors. You need to call this function after initializing the theme with $mdThemingProvider.

In Pip.WebUI.Themes module has Default and Bootbarn configuration. You can also add existing themes: blue, pink, green, amber, orange,

Default Themes configuration includes blue, pink, amber, orange, green, navy and grey themes. Register pipTheme.Default module in angular module dependencies before registration pipTheme module.

Register pipTheme module in angular module dependencies.

angular.module('myApp',[..., 'pipTheme.Default', 'pipTheme']);

For change theme use pipTheme.setCurrentTheme(theme); function

You can register Custom Theme. Configuring of the default theme is done by using the $mdThemingProvider during application configuration. You can specify a color palette for a given color intention by calling the appropriate configuration method (theme.primaryPalette, theme.accentPalette, theme.warnPalette, theme.backgroundPalette).

(function () {
    'use strict';
    var thisModule = angular.module('pipTheme.Green', ['ngMaterial']);

    thisModule.config(config);

    function config($mdThemingProvider, pipTranslateProvider) {

        var greenBackgroundPalette = $mdThemingProvider.extendPalette('grey', {
            'A100': 'rgba(250, 250, 250, 1)',
            'A200': 'rgba(76, 175, 80, 1)'
        });
        $mdThemingProvider.definePalette('green-background', greenBackgroundPalette);

        var greenPrimaryPalette = $mdThemingProvider.extendPalette('green', {
            '300': '#9ed4a1',
            'contrastLightColors': ['500', '300']
        });
        $mdThemingProvider.definePalette('green-primary', greenPrimaryPalette);

        var greenAccentPalette = $mdThemingProvider.extendPalette('amber', {
            'contrastLightColors': ['A700']
        });
        $mdThemingProvider.definePalette('green-accent', greenAccentPalette);

        $mdThemingProvider.theme('green')
            .primaryPalette('green-primary', {
                'default': '500',
                'hue-1': '300'
            })
            .backgroundPalette('green-background', {
                'default': '50',  
                'hue-1': 'A200',  
                'hue-2': 'A700'   
            })
            .warnPalette('red', {
                'default': 'A200'
            })
            .accentPalette('green-accent', {
                'default': 'A700'
            });
        $mdThemingProvider.alwaysWatchTheme(true);
    }
})();

You may add variables for themes class and after call mixin generate-theme.

@color-green-primary:                  rgba(76, 175, 80, 1);
@color-green-accent:                   rgba(255, 171, 0, 1);
@color-green-hue:                      rgba(76, 175, 80, .54);
@color-green-accent-hue:               rgba(255, 171, 0, .54);
@color-green-warm:                     rgba(255, 171, 0, .38);

@color-primary:                        rgba(0, 0, 0, 0.87);
@color-secondary:                      rgba(0, 0, 0, 0.54);
@color-error:                          rgb(244, 67, 54);
@color-badge:                          rgba(255, 82, 82, 1);
@color-toast:                          rgba(46, 46, 46, 1);
@color-divider:                        rgba(0, 0, 0, 0.12);
@color-window:                         rgb(238, 238, 238);
@color-content:                        rgb(250, 250, 250);

@color-green-theme:
        @color-green-primary // primary color
        @color-green-accent  // accent color
        @color-green-hue    // primary color wich some opacity
        @color-primary    // text color  
        @color-secondary  // text color with some opacity 
        @color-error // error color
        @color-divider  // color for dividers  
        @color-toast    // background color for toasts    
        @color-error // background color for badge   
        @color-content // background color for content window
        @color-window // background color for window
        @color-green-accent-hue; // accent color wich some opacity

.generate-theme(green, @color-green-theme);

You can use theme in html

    // Use theme class in html
    <div class="color-primary"> color-primary</div>
    <div class="color-primary-bg"> color-primary-bg</div>
    <div class="color-accent"> color-accent</div>
    <div class="color-accent-bg"> color-accent-bg</div>
    ...
    <md-button class="md-primary md-hue-1">Primary Hue 1</md-button>

Register pipTheme module in angular module dependencies and use pipTheme.use function for change current theme.

angular.module('myApp',[..., 'pipTheme']);

...

 thisModule.controller('MyController',
    function ($scope, pipTheme) {
        $scope.setCurrentTheme = setCurrentTheme;

        return;

        function setCurrentTheme(theme) {
            pipTheme.use(theme);
        };
    })

And more... Please, look at User's guide for details.

Learn more about the module

Module dependencies

  • pip-webui-lib: angular, angular material and other 3rd party libraries

License

This module is released under MIT license and totally free for commercial and non-commercial use.