Get started
Installation
- Install the librarybash
$ pnpm install lnxjs-components1bash$ npm install lnxjs-components1bash$ yarn add lnxjs-components1 - In your entry file (usually
main.jsormain.ts), import the library base:tsimport { createApp } from 'vue' import App from './App.vue' import 'lnxjs-components/dist/base.css'; createApp(App).mount('#app')1
2
3
4
5
6 - Set the
data-themeattribute in yourhtmltag to the theme you want to use:html<!DOCTYPE html> <html lang=""> <html lang="" data-theme="bobcat"> <head> <meta charset="UTF-8"> <link rel="icon" href="/favicon.ico"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Vite App</title> </head> <body> <div id="app"></div> <script type="module" src="/src/main.ts"></script> </body> </html>1
2
3
4
5
6
7
8
9
10
11
12
13
14 - If you don't want to use default themes, create a .scss file where you want with your custom css variables:And then import it in your entry file:scss
:root { --lnx-color-primary: <whatever>; --lnx-color-primary-light: <whatever>; --lnx-color-primary-dark: <whatever>; --lnx-color-primary-accent: <whatever>; /* ... */ }1
2
3
4
5
6
7tsimport { createApp } from 'vue' import App from './App.vue' import 'lnxjs-components/dist/base.css'; import 'custom-theme.css'; createApp(App).mount('#app')1
2
3
4
5
6
7TIP
You can check available css variables in each theme docs for global styles or in each component docs for component-specific styles