New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ng-theme

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-theme

![npm](https://img.shields.io/npm/dt/ng-theme) ![npm](https://img.shields.io/npm/v/ng-theme) ![GitHub issues](https://img.shields.io/github/issues/mrharrisonbarker/ng-theme) ![NPM](https://img.shields.io/npm/l/ng-theme) [![Build Status](https://travis-ci.

latest
Source
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

ng-theme

npm npm GitHub issues NPM Build Status

Angular theming libary.

  • Collection of defualt themes
  • Injectable custom themes
  • Auto theming based on HTML element
  • Toggle and dropdown components
  • Theme service and directive

Install

npm install ng-time-from-pipe

ng-theme-service

Varibles
AttributeType
currentThemeTheme
themesTheme []
Methods
AttributeDescription
setTheme ( themeName:string )will set current theme to theme supplied
toggleTheme ( firstThemeName: string, secondThemeName: string )toggles between two themes
listen : Observableobservable, sends message when the theme updates
nextThemesets current theme to the next theme in the themes array

ng-theme-directive

inputs
AttributeDescription
NgTheme : string"style:theme variable"

ng-theme-preview

inputs
AttributeDescription
themetheme to preview
<ng-theme-preview [theme]="theme"></ng-theme-preview>

Usage

import { NgThemeModule, NgThemeDirectiveModule, NgThemeComponentsModule } from 'projects/ng-theme/src/public-api';
@NgModule( { 
  declarations: [ ... ], 
  imports: [ ..., NgThemeModule, NgThemeDirectiveModule, NgThemeComponentsModule, ... ]
});
	imports: [ ..., NgThemeModule.forRoot({
		background: {
        backgroundOn: true,
        backgroundElement: 'body'
      },
      themes: [{
      	...
      }, {
      	...
      }]
	}), ... ]

Add NgTheme directive too any element you want to theme. the directive will auto theme based on the element. (not all elements are implemented).

  <h1 NgTheme>Hello World</h1>
  <h3 NgTheme>Hello World</h3>
  <a NgTheme>Hello World</a>
	<p NgTheme>Hello World</p>
	<i NgTheme>Hello World</i>
	<button NgTheme>Hello World</button>

You can also specify the theme variable you want to use.

	<div NgTheme="background-color:accent"></div> // css attr : theme variable

Theme

export class Theme
{
	public name: string;

	public primary: string;
	public primaryText: string;

	public secondary: string;
	public secondaryText?: string;

	public background: string;

	public linkText: string;

	public buttonText?: string;
	public buttonBorder?: string;
	public buttonBackground?: string;

	public jumbo: string;
  public jumboText: string;
    
 	public hr: string;
	
	public shadow: string;

	public isDark: boolean;
	public accent: string;

}
<ng-theme-dropdown></ng-theme-dropdown>
<ng-theme-toggle></ng-theme-toggle>

Keywords

Angular

FAQs

Package last updated on 03 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts