Skip to content

Commit

Permalink
refactor(@angular/build): template style elements should always be CSS
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
clydin authored and alan-agius4 committed Aug 20, 2024
1 parent 0676e2a commit e72eb05
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ export function createCompilerPlugin(
stylesheetResult = await stylesheetBundler.bundleInline(
data,
containingFile,
styleOptions.inlineStyleLanguage,
// Inline stylesheets from a template style element are always CSS
containingFile.endsWith('.html') ? 'css' : styleOptions.inlineStyleLanguage,
);
}

Expand Down

0 comments on commit e72eb05

Please sign in to comment.