@@ -11,14 +11,15 @@ import {
11
11
PullProp ,
12
12
RotateProp ,
13
13
SizeProp ,
14
+ Styles ,
14
15
Transform ,
15
16
} from '@fortawesome/fontawesome-svg-core' ;
16
17
import { FaConfig } from '../config' ;
17
18
import { FaIconLibrary } from '../icon-library' ;
18
19
import { faWarnIfIconDefinitionMissing } from '../shared/errors/warn-if-icon-html-missing' ;
19
20
import { faWarnIfIconSpecMissing } from '../shared/errors/warn-if-icon-spec-missing' ;
20
21
import { AnimationProp , FaProps } from '../shared/models/props.model' ;
21
- import { faClassList } from '../shared/utils/classlist.util' ;
22
+ import { faClassList , isKnownRotateValue } from '../shared/utils/classlist.util' ;
22
23
import { ensureCss } from '../shared/utils/css' ;
23
24
import { faNormalizeIconSpec } from '../shared/utils/normalize-icon-spec.util' ;
24
25
import { FaStackItemSizeDirective } from '../stack/stack-item-size.directive' ;
@@ -59,7 +60,7 @@ export class FaIconComponent implements OnChanges {
59
60
@Input ( ) border ?: boolean ;
60
61
@Input ( ) inverse ?: boolean ;
61
62
@Input ( ) symbol ?: FaSymbol ;
62
- @Input ( ) rotate ?: RotateProp ;
63
+ @Input ( ) rotate ?: RotateProp | string ;
63
64
@Input ( ) fixedWidth ?: boolean ;
64
65
@Input ( ) transform ?: string | Transform ;
65
66
@@ -147,6 +148,11 @@ export class FaIconComponent implements OnChanges {
147
148
148
149
const parsedTransform = typeof this . transform === 'string' ? parse . transform ( this . transform ) : this . transform ;
149
150
151
+ const styles : Styles = { } ;
152
+ if ( classOpts . rotate != null && ! isKnownRotateValue ( classOpts . rotate ) ) {
153
+ styles [ '--fa-rotate-angle' ] = `${ classOpts . rotate } ` ;
154
+ }
155
+
150
156
return {
151
157
title : this . title ,
152
158
transform : parsedTransform ,
@@ -156,6 +162,7 @@ export class FaIconComponent implements OnChanges {
156
162
attributes : {
157
163
role : this . a11yRole ,
158
164
} ,
165
+ styles,
159
166
} ;
160
167
}
161
168
}
0 commit comments