File tree Expand file tree Collapse file tree 4 files changed +23
-23
lines changed
examples/00 Chessboard/Tutorial App Expand file tree Collapse file tree 4 files changed +23
-23
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,25 @@ import Knight from './Knight';
4
4
import { DragDropContext } from 'react-dnd' ;
5
5
import HTML5Backend from 'react-dnd/modules/backends/HTML5' ;
6
6
7
+ // In a real app, you should use Autoprefixer
8
+ let testEl ;
9
+ function getDisplayFlexValue ( ) {
10
+ if ( typeof document === 'undefined' ) {
11
+ return 'flex' ;
12
+ }
13
+
14
+ if ( ! testEl ) {
15
+ testEl = document . createElement ( 'div' ) ;
16
+ }
17
+
18
+ testEl . style . display = '-webkit-flex' ;
19
+ if ( testEl . style . display === '-webkit-flex' ) {
20
+ return '-webkit-flex' ;
21
+ } else {
22
+ return 'flex' ;
23
+ }
24
+ }
25
+
7
26
@DragDropContext ( HTML5Backend )
8
27
export default class Board {
9
28
static propTypes = {
@@ -44,7 +63,7 @@ export default class Board {
44
63
< div style = { {
45
64
width : '100%' ,
46
65
height : '100%' ,
47
- display : typeof window !== 'undefined' && window . safari ? '-webkit-flex' : 'flex' , // Don't do that in a real app
66
+ display : getDisplayFlexValue ( ) ,
48
67
flexWrap : 'wrap' ,
49
68
WebkitFlexWrap : 'wrap'
50
69
} } >
Original file line number Diff line number Diff line change 72
72
"mocha" : " ^2.2.5" ,
73
73
"null-loader" : " ^0.1.0" ,
74
74
"postcss" : " ^4.0.2" ,
75
- "postcss-custom-properties" : " 3.0.1" ,
76
75
"react" : " ^0.13.3" ,
77
76
"react-hot-loader" : " ^1.2.3" ,
78
77
"react-router" : " ~0.13.2" ,
Original file line number Diff line number Diff line change 2
2
3
3
var postcss = require ( 'postcss' ) ;
4
4
var autoPrefixer = require ( 'autoprefixer' ) ;
5
- var customProperties = require ( 'postcss-custom-properties' ) ;
6
- var cssVars = require ( '../src/stubs/cssVar' ) ;
7
-
8
- function escapeSlash ( match ) {
9
- return match . replace ( / \/ / g, '_' ) ;
10
- }
11
-
12
- function slashTransform ( content ) {
13
- return content . replace ( / \. [ \w \/ \: \. ] + ( \s | \, ) / g, escapeSlash ) ;
14
- }
15
5
16
6
module . exports = function ( content ) {
17
7
if ( this && this . cacheable ) {
18
8
// Webpack specific call
19
9
this . cacheable ( ) ;
20
10
}
21
11
22
- content = slashTransform ( content ) ;
23
12
content = postcss ( )
24
- . use ( customProperties ( { variables : cssVars . CSS_VARS } ) )
25
13
. use ( autoPrefixer ( ) )
26
14
. process ( content ) . css ;
27
15
Original file line number Diff line number Diff line change @@ -39,22 +39,16 @@ module.exports = {
39
39
loaders : isDev ? [ 'react-hot-loader' , 'babel-loader' ] : [ 'babel-loader' ]
40
40
} ,
41
41
{
42
- test : / \. c s s $ / ,
42
+ test : / \. l e s s $ / ,
43
43
loader : ExtractTextPlugin . extract (
44
44
'style-loader' ,
45
45
[
46
46
'css-loader' ,
47
- path . join ( __dirname , '../scripts/cssTransformLoader' )
47
+ path . join ( __dirname , '../scripts/cssTransformLoader' ) ,
48
+ 'less-loader'
48
49
] . join ( '!' )
49
50
)
50
51
} ,
51
- {
52
- test : / \. l e s s $ / ,
53
- loader : ExtractTextPlugin . extract (
54
- 'style-loader' ,
55
- 'css-loader!less-loader'
56
- )
57
- } ,
58
52
{
59
53
test : / \. p n g $ / ,
60
54
loader : 'file-loader' ,
You can’t perform that action at this time.
0 commit comments