File tree Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,14 @@ const getPropTypeData = (name, varName) => {
25
25
} ;
26
26
} ;
27
27
28
+ const formatType = type => {
29
+ let formattedType = type . toLowerCase ( ) ;
30
+ if ( formattedType === 'color' ) {
31
+ formattedType += '_value' ; // MDN adds _value to color data type page, this discrepancy is unique
32
+ }
33
+ return formattedType ;
34
+ } ;
35
+
28
36
class StylingHooksTable extends Component {
29
37
render ( ) {
30
38
const { name, type } = this . props ;
@@ -109,14 +117,17 @@ class StylingHooksTable extends Component {
109
117
</ div >
110
118
</ td >
111
119
< td >
112
- { varData . types . map ( ( type , x ) => (
113
- < a
114
- key = { `${ category } -${ i } -${ ii } -${ x } ` }
115
- href = { `https://developer.mozilla.org/en-US/docs/Web/CSS/${ type . toLowerCase ( ) } ` }
116
- >
117
- { type }
118
- </ a >
119
- ) ) }
120
+ { varData . types . map ( ( type , x ) => {
121
+ const formattedType = formatType ( type ) ;
122
+ return (
123
+ < a
124
+ key = { `${ category } -${ i } -${ ii } -${ x } ` }
125
+ href = { `https://developer.mozilla.org/en-US/docs/Web/CSS/${ formattedType } ` }
126
+ >
127
+ { type }
128
+ </ a >
129
+ ) ;
130
+ } ) }
120
131
</ td >
121
132
< td > { varData . value } </ td >
122
133
</ tr >
You can’t perform that action at this time.
0 commit comments