1
0
mirror of https://github.com/kognise/water.css.git synced 2025-10-24 18:06:09 +02:00

Add NPM installation instructions and update goals (#221)

This commit is contained in:
Felix Mattick
2022-01-22 11:55:55 -06:00
parent 3decb548f4
commit 2e4933270e
3 changed files with 42 additions and 7 deletions

View File

@@ -17,7 +17,8 @@ const linkSnippets = [...document.querySelectorAll('#link-snippet-container > pr
const table = {
fileName: document.getElementById('table-file-name'),
fileSize: document.getElementById('table-file-size'),
theme: document.getElementById('table-theme')
theme: document.getElementById('table-theme'),
npm: document.getElementById('table-npm')
}
const prefersColorScheme = window.matchMedia('(prefers-color-scheme: light)')
@@ -55,6 +56,15 @@ const updateTheme = () => {
updateProductHunt(theme)
table.theme.innerText = `Theme is forced to ${theme}.`
}
table.npm.innerHTML = `
Install with <code>npm i water.css</code> or <code>yarn add water.css</code>.
<br><br>
In JavaScript, where CSS imports are supported:<br>
<code>import 'water.css/out/${fileName}'</code>
<br><br>
Usage from CSS depends on your bundler and dependency management setup, but in some cases may be as simple as a <code>@import</code>.
`
}
}