-
Notifications
You must be signed in to change notification settings - Fork 474
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
createStackingContext
mixin
- Loading branch information
1 parent
e9b43ca
commit bb0c684
Showing
4 changed files
with
29 additions
and
12 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
23 changes: 23 additions & 0 deletions
23
projects/cdk/schematics/ng-update/v4/steps/styles/migrate-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,23 @@ | ||
const MAPPING = { | ||
createStackingContext: ['isolation: isolate'], | ||
'scroll-behavior': ['scroll-behavior: var(--tui-scroll-behavior)'], | ||
}; | ||
|
||
export function migrateMixins(fileContent: string): string { | ||
if (!fileContent.includes('@taiga-ui/core/styles/taiga-ui-local')) { | ||
return fileContent; | ||
} | ||
|
||
return Object.keys(MAPPING).reduce((file, outdatedMixin) => { | ||
const MIXIN_RE = new RegExp( | ||
String.raw`(?:@include\s|\.)(${outdatedMixin})\(\)(\s?!important)?;`, | ||
'g', | ||
); | ||
|
||
return file.replaceAll( | ||
MIXIN_RE, | ||
(_, mixinName: keyof typeof MAPPING, important = '') => | ||
`${MAPPING[mixinName].map((newValue) => `${newValue}${important};`).join('\n')}`, | ||
); | ||
}, fileContent); | ||
} |
10 changes: 0 additions & 10 deletions
10
projects/cdk/schematics/ng-update/v4/steps/styles/migrate-scrollbar-behavior.ts
This file was deleted.
Oops, something went wrong.
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