Skip to content

Commit

Permalink
add styles as a package export for easier referencing - closes #9
Browse files Browse the repository at this point in the history
  • Loading branch information
nruffing committed Jan 6, 2024
1 parent 049baf2 commit 408bf48
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 17 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ Customizable native Vue3 data grid with very limited dependencies. Leverages a f

## Release Notes

### v3.2.0
- [#9](https://github.com/nruffing/data-grid-vue/issues/9): Add package export so styles can be loaded via `data-grid-vue/style`.

### v3.1.0
- Update ['dragon-drop-vue'](https://www.npmjs.com/package/dragon-drop-vue) dependency to v1.1.0
- update development dependencies
Expand Down
3 changes: 1 addition & 2 deletions dev-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"vue-tsc": "^1.8.25"
},
"dependencies": {
"debounce": "^2.0.0",
"dragon-drop-vue": "^1.1.0"
"data-grid-vue": "workspace:*"
}
}
Binary file added dev-app/public/favicon.ico
Binary file not shown.
3 changes: 2 additions & 1 deletion dev-app/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import { DataGridVue } from '../../lib/main'
import { DataGridVue } from 'data-grid-vue'
import 'data-grid-vue/style'

createApp(App).use(router).use(DataGridVue).mount('#app')
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
"types": "./dist/types/main.d.ts",
"import": "./dist/data-grid-vue.js",
"require": "./dist/data-grid-vue.umd.cjs"
}
},
"./style": "./dist/style.css"
},
"types": "./dist/types/main.d.ts",
"main": "dist/data-grid-vue.umd.js",
Expand Down
15 changes: 6 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vuepress/guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { createApp } from 'vue'
import App from './App.vue'
import { DataGridVue } from 'data-grid-vue'

import '../node_modules/data-grid-vue/dist/style.css'
import 'data-grid-vue/style'

createApp(App).use(DataGridVue).mount('#app')
```
Expand All @@ -46,7 +46,7 @@ createApp(App).use(DataGridVue).mount('#app')

Make sure to import the data grid core styles prior to any application-specific styles to be able to override the values of the predefined <a href="/theme" target="_blank">CSS Variables</a>.

The styles and variables can be imported from `../node_modules/data-grid-vue/dist/style.css`.
The styles and variables can be imported from `data-grid-vue/style`.

### Plugin Options

Expand All @@ -55,7 +55,7 @@ The `DataGridVue` plugin has additional options that can be specified. These opt
```ts
import { DataGridVue, type DataGridVueOptions } from 'data-grid-vue'

import '../node_modules/data-grid-vue/dist/style.css'
import 'data-grid-vue/style'

const dataGridVueOptions = {
dataGridComponentName: 'custom-data-grid',
Expand Down
3 changes: 3 additions & 0 deletions vuepress/shared/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Release Notes

### v3.2.0
- [#9](https://github.com/nruffing/data-grid-vue/issues/9): Add package export so styles can be loaded via `data-grid-vue/style`.

### v3.1.0
- Update ['dragon-drop-vue'](https://www.npmjs.com/package/dragon-drop-vue) dependency to v1.1.0
- update development dependencies
Expand Down
2 changes: 1 addition & 1 deletion vuepress/theme/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Here is a high level overview of the HTML that gets rendered.
Including the data grid's core styles will come with the CSS variables below. The below also includes their default values. The data grid can be themed by adjusting the values of these CSS variables. The core stylesheet can be loaded using an import statement similar to the following in your `main.ts` file. It is recommended to import it prior to any application stylesheets to be able to properly override the variable values.

```ts
import '../node_modules/data-grid-vue/dist/style.css'
import 'data-grid-vue/style'
```

::: tip Note
Expand Down

0 comments on commit 408bf48

Please sign in to comment.