Skip to content

Commit ea950cb

Browse files
authored
docs(Usage|Theming): improve pages, introduce CLI util (#3752)
1 parent 128e95d commit ea950cb

2 files changed

Lines changed: 36 additions & 46 deletions

File tree

docs/src/pages/Theming.mdx

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Button, Message } from 'semantic-ui-react'
1+
import { Accordion, Button, List, Message, Segment } from 'semantic-ui-react'
22

33
export const meta = {
44
title: 'Theming',
@@ -140,22 +140,37 @@ module.exports = {
140140
}
141141
```
142142

143-
<Message size='mini' warning>
144-
Make sure it installed <code>less</code> with version <code>>=3.0.0</code> as sometimes it will
145-
install <code>2.*</code> by default which will get you in the troubles.
146-
</Message>
147-
148143
### Scaffold custom styles
149144

150-
Now we need to copy necessary files with the skeleton of your customization.
145+
We made a special CLI tool that will copy necessary files with the skeleton of your customization.
151146

152147
```bash
153-
npx cpy-cli **/* ../../../src/semantic-ui/site --cwd node_modules/semantic-ui-less/_site --parents
148+
npx @semantic-ui-react/bootstrap
154149
```
155150

156-
```bash
157-
npx cpy-cli node_modules/semantic-ui-less/theme.config.example src/semantic-ui --rename=theme.config
158-
```
151+
<Accordion
152+
defaultActiveIndex={-1}
153+
panels={[
154+
{
155+
title: { content: <i>I want copy files manually</i>, style: { fontSize: '0.9rem' } },
156+
content: {
157+
as: Segment,
158+
content: (
159+
<List bulleted>
160+
<List.Item>
161+
Copy the entire <code>node_modules/semantic-ui-less/_site</code> folder to{' '}
162+
<code>src/semantic-ui/site</code>
163+
</List.Item>
164+
<List.Item>
165+
Copy <code>node_modules/semantic-ui-less/theme.config.example</code> to{' '}
166+
<code>src/semantic-ui/theme.config</code>
167+
</List.Item>
168+
</List>
169+
),
170+
},
171+
},
172+
]}
173+
/>
159174

160175
### `theme.config`
161176

docs/src/pages/Usage.mdx

Lines changed: 10 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -87,42 +87,17 @@ Choose a theme and delivery method that suits your needs:
8787

8888
## Bundling
8989

90-
Semantic UI React is fully supported by all modern JavaScript bundlers. We've made some
91-
example recipes with some of them. You can use these as a starting point for your project.
90+
Semantic UI React is fully supported by all modern JavaScript bundlers.
9291

93-
<Tab
94-
menu={{ attached: 'top', secondary: true, pointing: true, color: 'teal' }}
95-
panes={[
96-
{
97-
menuItem: 'Create React App',
98-
render: () => (
99-
<Tab.Pane style={{ fontSize: 'inherit' }}>
100-
<p>
101-
Semantic UI React is fully compatible with <code>create-react-app</code> and works out
102-
the box. Setup of custom theme is covered in <Link to='/theming'>Theming guide</Link>.
103-
</p>
104-
</Tab.Pane>
105-
),
106-
},
107-
{
108-
menuItem: 'Webpack 4',
109-
render: () => (
110-
<Tab.Pane style={{ fontSize: 'inherit' }}>
111-
<p>
112-
Semantic UI React is fully supported by Webpack 4, including tree shaking as of{' '}
113-
<code>semantic-ui-react@0.81.2</code>.
114-
</p>
115-
<p>
116-
Please ensure that you build your app in production mode before release. Semantic UI
117-
React includes several optimizations in production mode, such as stripping{' '}
118-
<code>propTypes</code>
119-
from your build.
120-
</p>
121-
</Tab.Pane>
122-
),
123-
},
124-
]}
125-
/>
92+
### Create React App
93+
94+
Semantic UI React is fully compatible with `create-react-app` and works out the box. Setup of custom theme is covered in [Theming guide](/theming).
95+
96+
### Webpack 4
97+
98+
Semantic UI React is fully supported by Webpack 4, including tree shaking as of `semantic-ui-react@0.81.2`.
99+
100+
Please ensure that you build your app in production mode before release. Semantic UI React includes several optimizations in production mode, such as stripping `propTypes` from your build.
126101

127102
<Divider hidden section />
128103

0 commit comments

Comments
 (0)