Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Commit 43ac072

Browse files
author
george
committed
minor copy tweaks
1 parent 613024e commit 43ac072

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

docs/download.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ Grab compiled assets if you need them statically.
2424
- CSS: [Download](https://github.com/geotrev/undernet/raw/master/dist/undernet.css.zip)
2525
- JS: [Download](https://github.com/geotrev/undernet/raw/master/dist/undernet.js.zip)
2626

27-
## Uncompiled CSS
27+
## Uncompiled & Unminified
2828

29-
Going this route allows for far more customization, but do so at your own risk. For the JavaScript in particular, you can exclude specific imports under the main `undernet.js` file to remove any unneeded components.
29+
Going this route allows for far more customization, but do so at your own risk. For the JavaScript in particular, you can exclude any unneeded component imports under the main `undernet.js` file.
3030

3131
- SCSS: [Download](https://github.com/geotrev/undernet/raw/master/dist/undernet.scss.zip)
3232
- JS: [Download](https://github.com/geotrev/undernet/raw/master/dist/undernet.modules.js.zip)
@@ -43,4 +43,13 @@ $ npm install undernet
4343
$ yarn add undernet
4444
```
4545

46+
And then import as you would normally:
47+
48+
```js
49+
// import all of Undernet
50+
import Undernet from "undernet"
51+
// or only grab a single component
52+
import Modal from "undernet/js/dist/components/modal"
53+
```
54+
4655
<p class="has-right-text">Is this article inaccurate? <a href="https://github.com/geotrev/undernet/tree/master/docs/download.md">Edit this page on Github!</a></p>

docs/javascript.md

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Just like in the [Introduction](/docs/overview/introduction) article, the fastes
1717
</head>
1818
<body>
1919
...
20-
<script type="text/javascript" src="path/to/undernet.bundle.min.js" async></script>
21-
<script type="text/javascript" async>
20+
<script type="text/javascript" src="path/to/undernet.bundle.min.js"></script>
21+
<script type="text/javascript">
2222
// Undernet is attached to the `window` object now.
2323
document.addEventListener('DOMContentLoaded', Undernet.start())
2424
</script>
@@ -54,23 +54,15 @@ export default class MyComponent extends React.Component {
5454

5555
Fun fact: this is how the components are showcased in the component docs.
5656

57-
## Customizing Component Imports
57+
### Customizing Component Imports
5858

59-
You may not want to include *every single* component in your project. For example, let's say you only need the [Modal](/docs/components/modals) component. You can do this in two ways.
60-
61-
### Import Directly from `dist/`
62-
63-
Simply import the component you need directly from its file. This works with or without NPM and Webpack.
59+
You may not want to include *every single* component in your project. For example, let's say you only need the [Modal](/docs/components/modals) component. Simply import the component you need directly from its file at the path `js/dist/components/`.
6460

6561
```js
6662
import Modal from 'undernet/js/dist/components/modal'
6763
Modal.start()
6864
```
6965

70-
*NOTE: Some components, such as Modals in the above example, rely on a helper Utils class. If you end up deleting unnecessary components to keep your project clean, remember to keep `utils.js`.*
71-
72-
### Tree Shaking
73-
74-
If you're using webpack, [tree shaking](https://webpack.js.org/guides/tree-shaking/) is available by default and will allow you to import from the global `Undernet` object and webpack will discard any unused components.
66+
*NOTE: Some components, such as Modals in the above example, rely on a helper `Utils` class. If you end up deleting unnecessary components to keep your project clean, remember to keep `utils.js`!*
7567

7668
<p class="has-right-text">Is this article inaccurate? <a href="https://github.com/geotrev/undernet/tree/master/docs/javascript.md">Edit this page on Github!</a></p>

0 commit comments

Comments
 (0)