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

Commit 094b430

Browse files
author
george
committed
proof edit download.md
1 parent bee24b9 commit 094b430

File tree

1 file changed

+19
-22
lines changed

1 file changed

+19
-22
lines changed

app/docs/download.md

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ See related documentation to learn the patterns and API in the framework's [CSS]
44

55
## CDN (easiest)
66

7-
The quickest way to use Undernet is to link the bundled js and minified css using a CDN, such as [jsdelivr](https://jsdelivr.com). Note that this route doesn't allow you to customize the style. For that, refer to the
7+
The quickest way to use Undernet is to link the bundled js and minified css using a CDN, such as [jsdelivr](https://jsdelivr.com). Note that this route doesn't allow you to customize the style. For that, refer to the NPM or source code options further below.
88

9-
Include the link tag before your custom CSS, and the script tag at the end of your `<body>` content.
9+
Include the link tag before your custom CSS to get styles, and the script tag at the end of your `<body>` content.
1010

1111
```html
1212
<html>
@@ -17,10 +17,10 @@ Include the link tag before your custom CSS, and the script tag at the end of yo
1717
integrity="sha256-CCXHgVlt68r/j/PKF3UN+LRGsKMI1Xlsvi2O2zjRupA="
1818
crossorigin="anonymous"
1919
/>
20-
<!-- add app styling here -->
20+
<!-- add other styles here -->
2121
</head>
2222
<body>
23-
<!-- add app content here -->
23+
<!-- add page content here -->
2424
<script
2525
type="text/javascript"
2626
src="https://cdn.jsdelivr.net/npm/undernet@6.0.0/dist/undernet.bundle.min.js"
@@ -34,14 +34,9 @@ Include the link tag before your custom CSS, and the script tag at the end of yo
3434
</html>
3535
```
3636

37-
Note that if you plan to link to and start Undernet via `<script>` tag, it's recommended to add an event listener for `DOMContentLoaded` to ensure the page is ready. Head over to the [JavaScript](/docs/overview/javascript) page to see more examples, including in UI frameworks like React.
37+
Note that if you plan to link to and start Undernet via `<script>` tag, it's recommended to add an event listener for `DOMContentLoaded`, as shown above, to ensure the page is ready.
3838

39-
```html
40-
<script>
41-
// Undernet is now attached to the `window`
42-
if (document) document.addEventListener("DOMContentLoaded", Undernet.start)
43-
</script>
44-
```
39+
Head over to the [JavaScript](/docs/overview/javascript) page to see more examples, including in UI frameworks like React.
4540

4641
## NPM or Yarn
4742

@@ -55,17 +50,19 @@ $ npm install -D undernet
5550
$ yarn add -D undernet
5651
```
5752

58-
Unlike if you use the CDN, the module _does not_ attach Undernet to the `window`.
53+
Unlike if you use the CDN, the default export of the module _does not_ attach Undernet to the `window`.
5954

60-
Also, note that Undernet uses global DOM variables like `window` and `document`, which can break server-side rendering. To avoid conflicts, component scripts internally check before execution. This should not affect SEO in any meaningful way as content isn't generated dynamically with Undernet's component scripts.
55+
Also, note that Undernet uses global DOM variables like `window` and `document`, which would normally break server-side rendering. To avoid conflicts, module scripts internally check against these globals before execution.
6156

62-
### Sass
57+
### Getting Sass from the NPM module
6358

64-
With NPM, you need to set up two files which import Undernet's Sass partials. In these examples, the Webpack shorthand `~` is used to access `node_modules` (it doesn't matter how you get the files, as long as they come from that folder).
59+
With NPM, you need to set up two files which import Undernet's Sass partials. In these examples, the Webpack shorthand `~` is used to access `node_modules`, however any alternative will do fine.
60+
61+
---
6562

6663
The first file is your config, which will have Sass helpers like variables, functions, and mixins. This can be imported wherever you want, as many times as you need, to get access to those utilities.
6764

68-
In your app, create a file called `_custom-config.scss` like so:
65+
In your app, create a file called `_config.scss` like so:
6966

7067
```scss
7168
@import "~undernet/src/scss/utilities/functions";
@@ -78,10 +75,10 @@ Note the comment; you can insert or import your variable overrides before the or
7875

7976
The next file should import the core framework, including all elements, components, and class utilities (you can forego any components/elements that aren't relevant to you). **Only import this file once at the global level**, otherwise you'll duplicate the selectors for each redundant import. Your application's Sass entry file is a good place to import it.
8077

81-
Create a file called `_custom-undernet.scss` like so:
78+
Create a file called `_undernet.scss` like so:
8279

8380
```scss
84-
@import "path/to/custom-config";
81+
@import "path/to/config";
8582
// .#{$style-scope} {
8683
@import "~undernet/src/scss/utilities/reset";
8784
@import "~undernet/src/scss/layout/grid";
@@ -97,25 +94,25 @@ Create a file called `_custom-undernet.scss` like so:
9794
@import "~undernet/src/scss/utilities/globals";
9895
```
9996

100-
Finally, import `custom-undernet.scss` to your app's Sass entry file, wherever that might be:
97+
Finally, import `_undernet.scss` to your app's Sass entry file, wherever that might be:
10198

10299
```css
103100
@import "path/to/custom-undernet";
104101
// all your other styles after
105102
```
106103

107-
... or link to the compiled CSS in your layout, before custom stylesheet links or style tags..
104+
... or link to the compiled CSS in your layout, before your app-specific styles..
108105

109106
```html
110107
<link rel="stylesheet" ref="path/to/custom-undernet.css" />
111108
<!-- all your other stylesheets/style tags after -->
112109
```
113110

114-
If you used scopes, disregard the suggestion above about importing before all other styles.
111+
If you used a style scope, you can disregard importing before all other styles.
115112

116113
## Source Files
117114

118-
Lastly, if you want to host the source files or minified versions diretly, you can do that too:
115+
Lastly, if you want to host the source files or minified versions directly, you can do that too:
119116

120117
### Minified & Compiled
121118

0 commit comments

Comments
 (0)