-
Notifications
You must be signed in to change notification settings - Fork 465
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cdk): missing migration schematic for mixins from `@taiga-ui/lega…
…cy/styles/taiga-ui-local`
- Loading branch information
1 parent
e9b43ca
commit b4f7742
Showing
3 changed files
with
40 additions
and
1 deletion.
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
34 changes: 34 additions & 0 deletions
34
projects/cdk/schematics/ng-update/v4/steps/styles/migrate-legacy-mixins.ts
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,34 @@ | ||
const LEGACY_MIXINS = [ | ||
'clearfix', | ||
'autofill', | ||
'clearinput', | ||
'visually-hidden', | ||
'webkit-auto-fill-button-hidden', | ||
'customize-scroll', | ||
'inset-border', | ||
'dashed-border', | ||
'opacity-icon', | ||
'hoverable-with-shadow', | ||
'text-overflow-with-fade', | ||
'contrast-background', | ||
'blurred-background', | ||
'textfield-host', | ||
'textfield-content', | ||
'textfield-input', | ||
'textfield-wrapper', | ||
'textfield-label', | ||
'input-icon', | ||
'input-icons', | ||
'icon-button', | ||
'textfield', | ||
]; | ||
|
||
export function migrateLegacyMixins(fileContent: string): string { | ||
if (!fileContent.includes('@taiga-ui/core/styles/taiga-ui-local')) { | ||
return fileContent; | ||
} | ||
|
||
return LEGACY_MIXINS.some((x) => fileContent.includes(x)) | ||
? `@import '@taiga-ui/legacy/styles/taiga-ui-local';\n${fileContent}` | ||
: fileContent; | ||
} |
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