Skip to content

Commit

Permalink
Merge pull request #326 from pulibrary/improve-docs-for-static-page
Browse files Browse the repository at this point in the history
Improve recommendations for adding Lux to a static HTML page
  • Loading branch information
christinach authored Aug 9, 2024
2 parents d06162a + 01abcf8 commit e56b541
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion docs/adding_lux.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,42 @@ Vue application and installs lux as a vue plugin.
app.use(lux)
.mount('#app');
```
If you are only using lux for a header and footer:
```
import { createApp } from 'vue';
import lux from 'lux-design-system';

const headerApp = createApp({});
headerApp.use(lux)
.mount('#lux-header-container')

const footerApp = createApp({});
footerApp.use(lux)
.mount('#lux-footer-container');
```

1. Import the CSS as from a CDN.
```
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/style.css">
```
1. Add lux components as needed in your HTML.
1. Add lux components as needed in your HTML. If you are just adding a
header and footer:
```
<div id="lux-header-container">
<lux-library-header app-name="Research Guides" abbr-name="Guides" app-url="https://libguides.princeton.edu/" theme="dark">
<lux-menu-bar type="main-menu" :menu-items="[
{name: 'Help', component: 'Help', href: 'https://library.princeton.edu/ask-us'},
{name: 'Your Accounts', component: 'Account', href: 'https://library.princeton.edu/accounts'}
]"
></lux-menu-bar>
</lux-library-header>
<!-- the rest of your page -->
<div id="lux-footer-container">
<lux-library-footer></lux-library-footer>
</div>
```
1. Add classes or CSS variables from lux to your styling.

##### Adding Lux to a static HTML page using an IIFE file
Expand Down

0 comments on commit e56b541

Please sign in to comment.