1-
2- # Angular JSS
1+ # NgStyled
32
43<img width =" 20% " height =" 20% " src =" ./logo.svg " >
54
65> [ JSS] ( https://cssinjs.org/ ) integration with Angular
76
8- [ ![ Version] ( https://img.shields.io/npm/v/@design4pro/angular-jss .svg?style=flat-square )] ( https://npmjs.org/package/@design4pro/angular-jss )
9- [ ![ License] ( https://img.shields.io/npm/l/@design4pro/angular-jss .svg?style=flat-square )] ( https://github.com/design4pro/angular-jss /jss/blob/master/LICENSE.md )
10- [ ![ Downloads] ( https://img.shields.io/npm/dm/@design4pro/angular-jss .svg?style=flat-square )] ( https://npmjs.org/package/@design4pro/angular-jss )
11- [ ![ Size] ( https://img.shields.io/bundlephobia/minzip/@design4pro/angular-jss .svg?style=flat-square )] ( https://npmjs.org/package/@design4pro/angular-jss )
7+ [ ![ Version] ( https://img.shields.io/npm/v/@design4pro/ng-styled .svg?style=flat-square )] ( https://npmjs.org/package/@design4pro/ng-styled )
8+ [ ![ License] ( https://img.shields.io/npm/l/@design4pro/ng-styled .svg?style=flat-square )] ( https://github.com/design4pro/ng-styled /jss/blob/master/LICENSE.md )
9+ [ ![ Downloads] ( https://img.shields.io/npm/dm/@design4pro/ng-styled .svg?style=flat-square )] ( https://npmjs.org/package/@design4pro/ng-styled )
10+ [ ![ Size] ( https://img.shields.io/bundlephobia/minzip/@design4pro/ng-styled .svg?style=flat-square )] ( https://npmjs.org/package/@design4pro/ng-styled )
1211[ ![ design4pro] ( https://img.shields.io/badge/@-design4pro-383636?style=flat-square&labelColor=8f68d4 )] ( https://github.com/design4pro/ )
1312
1413## Features
2928Using ` npm ` :
3029
3130``` sh
32- npm install @design4pro/angular-jss
31+ npm install @design4pro/ng-styled
3332```
3433
3534or using ` yarn ` :
3635
3736``` sh
38- yarn add @design4pro/angular-jss
37+ yarn add @design4pro/ng-styled
3938```
4039
4140## Usage
4241
43- Inject the ` AngularJssModule ` module into your root module:
42+ Inject the ` StyledModule ` module into your root module:
4443
4544``` ts
4645import { NgModule } from ' @angular/core' ;
4746import { BrowserModule } from ' @angular/platform-browser' ;
48- import { AngularJssModule } from ' @design4pro/angular-jss ' ;
47+ import { StyledModule } from ' @design4pro/ng-styled ' ;
4948import { AppComponent } from ' ./app.component' ;
5049
5150@NgModule ({
5251 declarations: [AppComponent ],
53- imports: [BrowserModule , AngularJssModule .forRoot ()],
52+ imports: [BrowserModule , StyledModule .forRoot ()],
5453 providers: [],
5554 bootstrap: [AppComponent ],
5655})
@@ -61,10 +60,10 @@ Use class decorator `Styled` to add styles to your component:
6160
6261``` ts
6362import { Component } from ' @angular/core' ;
64- import { Styled , StyledProp , Theme } from ' @design4pro/angular-jss ' ;
63+ import { Styled , StyledProp , Theme } from ' @design4pro/ng-styled ' ;
6564
6665@Component ({
67- selector: ' angular-jss -root' ,
66+ selector: ' ng-styled -root' ,
6867 templateUrl: ' ./app.component.html' ,
6968 styleUrls: [' ./app.component.css' ],
7069})
@@ -73,7 +72,8 @@ import { Styled, StyledProp, Theme } from '@design4pro/angular-jss';
7372 injectGlobal ({
7473 ' @global' : {
7574 ' :root' : {
76- ' --background-color' : (data : { backgroundColor: string }) => data .backgroundColor ,
75+ ' --background-color' : (data : { backgroundColor: string }) =>
76+ data .backgroundColor ,
7777 },
7878 },
7979 });
@@ -113,35 +113,32 @@ export class AppComponent {
113113import { create , Jss } from ' jss' ;
114114import extend from ' jss-plugin-extend' ;
115115import propsSort from ' jss-plugin-props-sort' ;
116- import { JssOptions } from ' @design4pro/angular-jss ' ;
116+ import { JssOptions , StyledModule , Theme } from ' @design4pro/ng-styled ' ;
117117
118118const jss: Jss = create ({
119119 // additional JSS plugins @see https://cssinjs.org/plugins?v=v10.9.0
120- plugins: [
121- extend (),
122- propsSort ()
123- ],
120+ plugins: [extend (), propsSort ()],
124121});
125122
126- const jssOptions : JssOptions = {
123+ const options : JssOptions = {
127124 jss: jss ,
128- normalize: false // disable normalizing (normalize.css)
125+ normalize: false , // disable normalizing (normalize.css)
129126};
130127
131128const theme: Theme = {
132129 palette: {
133130 primary: {
134- main: ' #00bcd4' // use in decorator `theme.palette?.primary?.main`
131+ main: ' #00bcd4' , // use in decorator `theme.palette?.primary?.main`
135132 },
136133 secondary: {
137- main: ' #f50057'
138- }
139- }
134+ main: ' #f50057' ,
135+ },
136+ },
140137};
141138
142139@NgModule ({
143140 declarations: [AppComponent ],
144- imports: [BrowserModule , AngularJssModule .forRoot (jssOptions , theme )],
141+ imports: [BrowserModule , StyledModule .forRoot (options , theme )],
145142 providers: [],
146143 bootstrap: [AppComponent ],
147144})
@@ -150,4 +147,4 @@ export class AppModule {}
150147
151148## License
152149
153- [ MIT] ( https://github.com/design4pro/angular-jss /blob/master/LICENSE.md ) © DESIGN4 ᴾ ᴿ ᴼ
150+ [ MIT] ( https://github.com/design4pro/ng-styled /blob/master/LICENSE.md ) © DESIGN4 ᴾ ᴿ ᴼ
0 commit comments