You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/index.md
+11-5
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,15 @@
4
4
`vue-web-component-wrapper` is a powerful Vue 3 plugin designed for transforming full-fledged Vue applications into reusable web components (custom elements). These web components can be integrated into any website, enhancing flexibility and reusability.
5
5
6
6
## Why use `vue-web-component-wrapper`?
7
-
As of now, Vue 3 does not support the creation of full aplication as web components out of the box. This plugin aims to solve this problem by providing a simple and easy-to-use solution for creating web components from Vue applications. It also provides support for Vue ecosystem plugins such as Vuex, Vue Router, and Vue I18n.
7
+
As of now, Vue 3 does not support the creation of full applications as web components out of the box. This plugin aims to solve this problem by providing a simple and easy-to-use solution for creating web components from Vue applications. It also provides support for Vue ecosystem plugins such as Vuex, Vue Router, and Vue I18n.
8
+
8
9
## Demo
9
10
Check out these demo projects to see `vue-web-component-wrapper` in action:
10
-
-**Webpack implentaion**: Check out this [Webpack Demo Project](https://stackblitz.com/edit/vue-web-component-wrapper?file=README.md&startScript=webpack-demo)
11
-
-**Vite.js implentaion**: Check out this [Vite Demo Project](https://stackblitz.com/edit/vue-web-component-wrapper?file=README.md&startScript=vite-demo)
11
+
-**Webpack implementation**: Check out this [Webpack Demo Project](https://stackblitz.com/edit/vue-web-component-wrapper?file=README.md&startScript=webpack-demo)
12
+
-**Vite.js implementation**: Check out this [Vite Demo Project](https://stackblitz.com/edit/vue-web-component-wrapper?file=README.md&startScript=vite-demo)
12
13
13
14
## Key Features
14
-
-**Vue Plugins Compatibility**: Integrates seamlessly with key Vue ecosystem plugins.
15
+
-**Vue Plugins Compatibility**: Seamlessly integrates with key Vue ecosystem plugins.
15
16
-**CSS Framework Support**: Compatible with major CSS frameworks like Tailwind CSS and Bootstrap.
16
17
-**CSS Preprocessor Support**: Supports CSS preprocessors including SCSS and LESS.
17
18
-**Scoped CSS**: Enables the use of scoped CSS in your components.
@@ -22,7 +23,12 @@ Check out these demo projects to see `vue-web-component-wrapper` in action:
22
23
-**Event Emitting Capability**: Enables the emission and handling of custom events from web components.
23
24
-**Disable Style Removal on Unmount**: Option to control the removal of styles upon component unmount, addressing issues with CSS transition.
24
25
-**Disable Shadow DOM**: Option to disable the Shadow DOM, rendering content in the light DOM.
26
+
-**Replace `:root` with `:host`**: New feature to replace `:root` selectors with `:host` in your CSS, ensuring proper style scoping within the Shadow DOM.
27
+
28
+
## New Feature Highlight: Replace `:root` with `:host`
29
+
Our latest feature allows you to automatically replace `:root` selectors with `:host` in your CSS styles. This is particularly useful when working with CSS frameworks or custom styles that define variables or styles on the `:root` selector. By replacing `:root` with `:host`, these styles are correctly scoped within your web component's Shadow DOM.
25
30
31
+
[Learn more about the Replace `:root` with `:host` feature](./guide/replace-root-with-host.md)
26
32
27
33
## Tips
28
-
-**Testing Production Build**: the easiest way to test your production build is to run a local server in the `dist` folder. I use [valet](https://laravel.com/docs/10.x/valet) for this, but any local server should work.
34
+
-**Testing Production Build**: The easiest way to test your production build is to run a local server in the `dist` folder. You can use [valet](https://laravel.com/docs/10.x/valet) for this, but any local server should work.
Copy file name to clipboardExpand all lines: docs/usage.md
+3-1
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,7 @@ createWebComponent({
58
58
getCurrentInstance,
59
59
disableStyleRemoval:false,
60
60
disableShadowDOM:false,
61
+
replaceRootWithHost:false,
61
62
});
62
63
```
63
64
Each option in the `createWebComponent` function has a specific purpose:
@@ -70,4 +71,5 @@ Each option in the `createWebComponent` function has a specific purpose:
70
71
-`createApp`: The `createApp` function from Vue.
71
72
-`getCurrentInstance`: The `getCurrentInstance` function from Vue.
72
73
-`disableStyleRemoval`: A boolean value that determines whether or not to remove styles on unmount. This is useful for CSS transitions.
73
-
-`disableShadowDOM`: A boolean value that determines whether or not to use Shadow DOM for the web component.
74
+
-`disableShadowDOM`: A boolean value that determines whether or not to use Shadow DOM for the web component.
75
+
-`replaceRootWithHost`: A boolean value that determines whether or not to replace `:root` with `:host` in your CSS framework styles. This is useful for CSS variables that penetrate the Shadow DOM.
0 commit comments