@@ -4,29 +4,28 @@ import { transformBorderColor } from './borderColor'
4
4
import { transformBorderStyle } from './borderStyle'
5
5
import { transformBorderWidth } from './borderWidth'
6
6
7
- const borderWidth = ( ) : string => {
8
- if ( __NODE_JS__ ) {
9
- return '-width'
10
- }
11
- return 'Width'
12
- }
13
- const borderStyle = ( ) : string => {
14
- if ( __NODE_JS__ ) {
15
- return '-style'
16
- }
17
- return 'Style'
18
- }
19
- const borderColor = ( ) : string => {
20
- if ( __NODE_JS__ ) {
21
- return '-color'
22
- }
23
- return 'Color'
24
- }
25
-
26
7
export function createTransformBorder (
27
8
options : NormalizeOptions
28
9
) : TransformDecl {
29
10
return ( decl : Declaration ) : Declaration [ ] => {
11
+ const borderWidth = ( ) : string => {
12
+ if ( __NODE_JS__ ) {
13
+ return '-width'
14
+ }
15
+ return 'Width'
16
+ }
17
+ const borderStyle = ( ) : string => {
18
+ if ( __NODE_JS__ ) {
19
+ return '-style'
20
+ }
21
+ return 'Style'
22
+ }
23
+ const borderColor = ( ) : string => {
24
+ if ( __NODE_JS__ ) {
25
+ return '-color'
26
+ }
27
+ return 'Color'
28
+ }
30
29
const { prop, value, important, raws, source } = decl
31
30
const splitResult = value . replace ( / \s * , \s * / g, ',' ) . split ( / \s + / )
32
31
const result : Array < string | null > = [
@@ -139,6 +138,10 @@ export function createTransformBorderNvue(
139
138
options : NormalizeOptions
140
139
) : TransformDecl {
141
140
return ( decl ) => {
141
+ const borderWidth = __NODE_JS__ ? '-width' : 'Width'
142
+ const borderStyle = __NODE_JS__ ? '-style' : 'Style'
143
+ const borderColor = __NODE_JS__ ? '-color' : 'Color'
144
+
142
145
const { prop, value, important, raws, source } = decl
143
146
const splitResult = value . replace ( / \s * , \s * / g, ',' ) . split ( / \s + / )
144
147
const result = [
@@ -155,14 +158,14 @@ export function createTransformBorderNvue(
155
158
return [
156
159
createDecl (
157
160
prop + borderWidth ,
158
- ( result [ 0 ] || ( options . type === 'uvue' ? 'medium' : '0' ) ) . trim ( ) ,
161
+ ( result [ 0 ] || '0' ) . trim ( ) ,
159
162
important ,
160
163
raws ,
161
164
source
162
165
) ,
163
166
createDecl (
164
167
prop + borderStyle ,
165
- ( result [ 1 ] || ( options . type === 'uvue' ? 'none' : ' solid') ) . trim ( ) ,
168
+ ( result [ 1 ] || ' solid') . trim ( ) ,
166
169
important ,
167
170
raws ,
168
171
source
0 commit comments