Skip to content

Commit e72eb05

Browse files
clydinalan-agius4
authored andcommitted
refactor(@angular/build): template style elements should always be CSS
Now that style elements within templates are processed as inline component styles, the style contents should only be considered CSS. This ensures consistent behavior prior to when style elements were processed. It also ensures that the styles will function as expected in JIT mode where template styles cannot be preprocessed and must be written in a browser supported language.
1 parent 0676e2a commit e72eb05

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/angular/build/src/tools/esbuild/angular/compiler-plugin.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ export function createCompilerPlugin(
185185
stylesheetResult = await stylesheetBundler.bundleInline(
186186
data,
187187
containingFile,
188-
styleOptions.inlineStyleLanguage,
188+
// Inline stylesheets from a template style element are always CSS
189+
containingFile.endsWith('.html') ? 'css' : styleOptions.inlineStyleLanguage,
189190
);
190191
}
191192

0 commit comments

Comments
 (0)