Skip to content

Commit 77f6639

Browse files
committed
fix(IE 11 Compatibility): Use createGlobalStyle instead of injectGlobal to inject global css styles
#152
1 parent 244339f commit 77f6639

4 files changed

Lines changed: 40 additions & 34 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"redux-actions": "^2.6.1",
4848
"redux-logger": "^3.0.6",
4949
"smooth-dnd": "0.6.2",
50-
"styled-components": "^3.4.10",
50+
"styled-components": "4.0.3",
5151
"uuid": "^3.3.2"
5252
},
5353
"devDependencies": {

src/components/Board.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
import React, {Component} from 'react'
22
import BoardContainer from './BoardContainer'
33
import {Provider} from 'react-redux'
4-
import {createStore, applyMiddleware} from 'redux'
4+
import {applyMiddleware, createStore} from 'redux'
55
import boardReducer from '../reducers/BoardReducer'
66
import logger from 'redux-logger'
7-
import uuidv1 from "uuid/v1"
7+
import uuidv1 from 'uuid/v1'
8+
import {GlobalStyle} from '../styles/Base'
89

910
const middlewares = process.env.REDUX_LOGGING ? [logger] : []
1011

1112
export default class Board extends Component {
1213
constructor() {
1314
super()
14-
this.store = this.getStore();
15+
this.store = this.getStore()
1516
this.id = uuidv1()
1617
}
1718

@@ -23,7 +24,10 @@ export default class Board extends Component {
2324
render() {
2425
return (
2526
<Provider store={this.store}>
26-
<BoardContainer className="react-trello-board" {...this.props} id={this.id}/>
27+
<>
28+
<GlobalStyle />
29+
<BoardContainer className="react-trello-board" {...this.props} id={this.id} />
30+
</>
2731
</Provider>
2832
)
2933
}

src/styles/Base.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import styled, {injectGlobal} from 'styled-components'
1+
import styled, {createGlobalStyle} from 'styled-components'
22

3-
injectGlobal`
3+
export const GlobalStyle = createGlobalStyle`
44
.comPlainTextContentEditable {
55
-webkit-user-modify: read-write-plaintext-only;
66
}

yarn.lock

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2397,6 +2397,16 @@ babel-plugin-react-docgen@^2.0.0-babel7.0:
23972397
lodash "^4.17.10"
23982398
react-docgen "^3.0.0-rc.1"
23992399

2400+
"babel-plugin-styled-components@>= 1":
2401+
version "1.10.0"
2402+
resolved "https://registry.yarnpkg.com/babel-plugin-styled-components/-/babel-plugin-styled-components-1.10.0.tgz#ff1f42ad2cc78c21f26b62266b8f564dbc862939"
2403+
integrity sha512-sQVKG8irFXx14ZfaK1bBePirfkacl3j8nZwSZK+ZjsbnadRHKQTbhXbe/RB1vT6Vgkz45E+V95LBq4KqdhZUNw==
2404+
dependencies:
2405+
"@babel/helper-annotate-as-pure" "^7.0.0"
2406+
"@babel/helper-module-imports" "^7.0.0"
2407+
babel-plugin-syntax-jsx "^6.18.0"
2408+
lodash "^4.17.10"
2409+
24002410
babel-plugin-syntax-async-functions@^6.8.0:
24012411
version "6.13.0"
24022412
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95"
@@ -3250,14 +3260,6 @@ buffer@^4.3.0:
32503260
ieee754 "^1.1.4"
32513261
isarray "^1.0.0"
32523262

3253-
buffer@^5.0.3:
3254-
version "5.2.1"
3255-
resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.2.1.tgz#dd57fa0f109ac59c602479044dca7b8b3d0b71d6"
3256-
integrity sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==
3257-
dependencies:
3258-
base64-js "^1.0.2"
3259-
ieee754 "^1.1.4"
3260-
32613263
builtin-modules@^1.0.0:
32623264
version "1.1.1"
32633265
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
@@ -4070,7 +4072,7 @@ css-selector-tokenizer@^0.7.0:
40704072
fastparse "^1.1.1"
40714073
regexpu-core "^1.0.0"
40724074

4073-
css-to-react-native@^2.0.3:
4075+
css-to-react-native@^2.2.2:
40744076
version "2.2.2"
40754077
resolved "https://registry.yarnpkg.com/css-to-react-native/-/css-to-react-native-2.2.2.tgz#c077d0f7bf3e6c915a539e7325821c9dd01f9965"
40764078
integrity sha512-w99Fzop1FO8XKm0VpbQp3y5mnTnaS+rtCvS+ylSEOK76YXO5zoHQx/QMB1N54Cp+Ya9jB9922EHrh14ld4xmmw==
@@ -5333,7 +5335,7 @@ fb-watchman@^2.0.0:
53335335
dependencies:
53345336
bser "^2.0.0"
53355337

5336-
fbjs@^0.8.16, fbjs@^0.8.4, fbjs@^0.8.5, fbjs@^0.8.9:
5338+
fbjs@^0.8.4, fbjs@^0.8.5, fbjs@^0.8.9:
53375339
version "0.8.17"
53385340
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd"
53395341
integrity sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90=
@@ -6224,11 +6226,6 @@ hoist-non-react-statics@1.x.x, hoist-non-react-statics@^1.2.0:
62246226
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-1.2.0.tgz#aa448cf0986d55cc40773b17174b7dd066cb7cfb"
62256227
integrity sha1-qkSM8JhtVcxAdzsXF0t90GbLfPs=
62266228

6227-
hoist-non-react-statics@^2.5.0:
6228-
version "2.5.5"
6229-
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz#c5903cf409c0dfd908f388e619d86b9c1174cb47"
6230-
integrity sha512-rqcy4pJo55FTTLWt+bU8ukscqHeE/e9KWvsOW2b/a3afxQZhwkQdT1rPPCJ0rYXdj4vNcasY8zHTH+jF/qStxw==
6231-
62326229
hoist-non-react-statics@^3.1.0:
62336230
version "3.2.1"
62346231
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.2.1.tgz#c09c0555c84b38a7ede6912b61efddafd6e75e1e"
@@ -7917,6 +7914,11 @@ mem@^1.1.0:
79177914
dependencies:
79187915
mimic-fn "^1.0.0"
79197916

7917+
memoize-one@^4.0.0:
7918+
version "4.1.0"
7919+
resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-4.1.0.tgz#a2387c58c03fff27ca390c31b764a79addf3f906"
7920+
integrity sha512-2GApq0yI/b22J2j9rhbrAlsHb0Qcz+7yWxeLG8h+95sl1XPUgeLimQSOdur4Vw7cUhrBHwaUZxWFZueojqNRzA==
7921+
79207922
memory-fs@^0.4.0, memory-fs@~0.4.1:
79217923
version "0.4.1"
79227924
resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552"
@@ -9729,7 +9731,7 @@ react-inspector@^2.3.0:
97299731
is-dom "^1.0.9"
97309732
prop-types "^15.6.1"
97319733

9732-
react-is@^16.3.1, react-is@^16.3.2, react-is@^16.6.0:
9734+
react-is@^16.3.2, react-is@^16.6.0:
97339735
version "16.6.3"
97349736
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.6.3.tgz#d2d7462fcfcbe6ec0da56ad69047e47e56e7eac0"
97359737
integrity sha512-u7FDWtthB4rWibG/+mFbVd5FvdI20yde86qKGx4lVUTWmPlSWQ4QxbBIrrs+HnXGbxOUlUzTAP/VDmvCwaP2yA==
@@ -11228,20 +11230,20 @@ style-loader@^0.23.0:
1122811230
loader-utils "^1.1.0"
1122911231
schema-utils "^1.0.0"
1123011232

11231-
styled-components@^3.4.10:
11232-
version "3.4.10"
11233-
resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-3.4.10.tgz#9a654c50ea2b516c36ade57ddcfa296bf85c96e1"
11234-
integrity sha512-TA8ip8LoILgmSAFd3r326pKtXytUUGu5YWuqZcOQVwVVwB6XqUMn4MHW2IuYJ/HAD81jLrdQed8YWfLSG1LX4Q==
11233+
styled-components@4.0.3:
11234+
version "4.0.3"
11235+
resolved "https://registry.yarnpkg.com/styled-components/-/styled-components-4.0.3.tgz#6c1a95a93857aa613fdfc26ad40899217100d8c3"
11236+
integrity sha512-oEZovK4xMGAMhOA9h74dCYJsp3IwUFhEvtYe4gwTy0cBZ3a17YMxBfM2oXsEoED9f+HCM5UQZW2h297n4u8hUw==
1123511237
dependencies:
11236-
buffer "^5.0.3"
11237-
css-to-react-native "^2.0.3"
11238-
fbjs "^0.8.16"
11239-
hoist-non-react-statics "^2.5.0"
11238+
"@emotion/is-prop-valid" "^0.6.8"
11239+
babel-plugin-styled-components ">= 1"
11240+
css-to-react-native "^2.2.2"
11241+
memoize-one "^4.0.0"
1124011242
prop-types "^15.5.4"
11241-
react-is "^16.3.1"
11243+
react-is "^16.6.0"
1124211244
stylis "^3.5.0"
1124311245
stylis-rule-sheet "^0.0.10"
11244-
supports-color "^3.2.3"
11246+
supports-color "^5.5.0"
1124511247

1124611248
stylis-rule-sheet@^0.0.10:
1124711249
version "0.0.10"
@@ -11265,7 +11267,7 @@ supports-color@^2.0.0:
1126511267
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
1126611268
integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=
1126711269

11268-
supports-color@^3.1.2, supports-color@^3.2.3:
11270+
supports-color@^3.1.2:
1126911271
version "3.2.3"
1127011272
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6"
1127111273
integrity sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=

0 commit comments

Comments
 (0)