Skip to content

Commit

Permalink
lint: Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tjtanjin committed Oct 11, 2024
1 parent a0426d7 commit 8058491
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/services/ThemeService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,22 +156,22 @@ export const processAndFetchThemeConfig = async (botId: string, theme: Theme):
*/
const getScopedCssStylesText = (botId: string, cssStylesText: string) => {
const scopedCssText = cssStylesText.split(/(?<=})/)
.map(rule => {
const trimmedRule = rule.trim();
// ignores comments
if (trimmedRule.startsWith('/*')) {
.map(rule => {
const trimmedRule = rule.trim();
// ignores comments
if (trimmedRule.startsWith('/*')) {
return trimmedRule;
}

// ignores imports, keyframes and media queries
if (trimmedRule.startsWith('@import') || trimmedRule.startsWith('@keyframes')
// ignores imports, keyframes and media queries
if (trimmedRule.startsWith('@import') || trimmedRule.startsWith('@keyframes')
|| trimmedRule.startsWith('@media')) {
return trimmedRule;
}
return trimmedRule;
}

// scopes regular css rules with bot id
return trimmedRule ? `#${botId} ${trimmedRule}` : '';
})
.join('\n');
// scopes regular css rules with bot id
return trimmedRule ? `#${botId} ${trimmedRule}` : '';
})
.join('\n');
return scopedCssText;
}

0 comments on commit 8058491

Please sign in to comment.