@@ -11,14 +11,15 @@ import {
1111 PullProp ,
1212 RotateProp ,
1313 SizeProp ,
14+ Styles ,
1415 Transform ,
1516} from '@fortawesome/fontawesome-svg-core' ;
1617import { FaConfig } from '../config' ;
1718import { FaIconLibrary } from '../icon-library' ;
1819import { faWarnIfIconDefinitionMissing } from '../shared/errors/warn-if-icon-html-missing' ;
1920import { faWarnIfIconSpecMissing } from '../shared/errors/warn-if-icon-spec-missing' ;
2021import { AnimationProp , FaProps } from '../shared/models/props.model' ;
21- import { faClassList } from '../shared/utils/classlist.util' ;
22+ import { faClassList , isKnownRotateValue } from '../shared/utils/classlist.util' ;
2223import { ensureCss } from '../shared/utils/css' ;
2324import { faNormalizeIconSpec } from '../shared/utils/normalize-icon-spec.util' ;
2425import { FaStackItemSizeDirective } from '../stack/stack-item-size.directive' ;
@@ -59,7 +60,7 @@ export class FaIconComponent implements OnChanges {
5960 @Input ( ) border ?: boolean ;
6061 @Input ( ) inverse ?: boolean ;
6162 @Input ( ) symbol ?: FaSymbol ;
62- @Input ( ) rotate ?: RotateProp ;
63+ @Input ( ) rotate ?: RotateProp | string ;
6364 @Input ( ) fixedWidth ?: boolean ;
6465 @Input ( ) transform ?: string | Transform ;
6566
@@ -147,6 +148,11 @@ export class FaIconComponent implements OnChanges {
147148
148149 const parsedTransform = typeof this . transform === 'string' ? parse . transform ( this . transform ) : this . transform ;
149150
151+ const styles : Styles = { } ;
152+ if ( classOpts . rotate != null && ! isKnownRotateValue ( classOpts . rotate ) ) {
153+ styles [ '--fa-rotate-angle' ] = `${ classOpts . rotate } ` ;
154+ }
155+
150156 return {
151157 title : this . title ,
152158 transform : parsedTransform ,
@@ -156,6 +162,7 @@ export class FaIconComponent implements OnChanges {
156162 attributes : {
157163 role : this . a11yRole ,
158164 } ,
165+ styles,
159166 } ;
160167 }
161168}
0 commit comments