-
Notifications
You must be signed in to change notification settings - Fork 477
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: move fonts to separate file (#2132)
* refactor!: move fonts to separate file * chore: remove global styles from schematic
- Loading branch information
1 parent
6a83977
commit 85d5ede
Showing
25 changed files
with
170 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const TAIGA_GLOBAL_STYLE = | ||
'node_modules/@taiga-ui/core/styles/taiga-ui-global.less'; | ||
export const TAIGA_THEME_STYLE = 'node_modules/@taiga-ui/core/styles/taiga-ui-theme.less'; | ||
export const TAIGA_THEME_FONTS = 'node_modules/@taiga-ui/core/styles/taiga-ui-fonts.less'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,12 @@ | ||
import {JsonArray} from '@angular-devkit/core'; | ||
import {Rule, Tree} from '@angular-devkit/schematics'; | ||
import {updateWorkspace} from '@schematics/angular/utility/workspace'; | ||
import {getProject} from '../../utils/get-project'; | ||
import {getProjectTargetOptions} from '../../utils/get-project-target-options'; | ||
import {Schema} from '../schema'; | ||
|
||
const TAIGA_GLOBAL_STYLE = 'node_modules/@taiga-ui/core/styles/taiga-ui-global.less'; | ||
const TAIGA_THEME_STYLE = 'node_modules/@taiga-ui/core/styles/taiga-ui-theme.less'; | ||
import {addStylesToAngularJson} from '../../utils/add-styles'; | ||
import {TAIGA_THEME_FONTS, TAIGA_THEME_STYLE} from '../../constants/taiga-styles'; | ||
|
||
export function addTaigaStyles(options: Schema): Rule { | ||
return async (_: Tree) => { | ||
return addTaigaStylesToAngularJson(options); | ||
}; | ||
} | ||
const taigaStyles = [TAIGA_THEME_STYLE, TAIGA_THEME_FONTS]; | ||
|
||
export function addTaigaStylesToAngularJson(options: Schema): Rule { | ||
return updateWorkspace(workspace => { | ||
const project = getProject(options, workspace); | ||
const targetOptions = getProjectTargetOptions(project, 'build'); | ||
const styles = targetOptions.styles as JsonArray | undefined; | ||
const taigaStyles = [TAIGA_GLOBAL_STYLE, TAIGA_THEME_STYLE]; | ||
|
||
targetOptions.styles = styles | ||
? Array.from(new Set([...taigaStyles, ...styles])) | ||
: taigaStyles; | ||
}); | ||
return addStylesToAngularJson(options, taigaStyles); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.