vue-multiple-themes 1.3.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ 1.0.1
2
+
3
+ - Add Documents
4
+ - Add License
5
+
6
+ 1.0.8
7
+
8
+ - Add font-icon
9
+ - Fix bug after change routing in mounted
10
+ - Persisted an array for 3 constant colors
11
+ - Add new props for custom style
@@ -253,7 +253,7 @@ var __vue_staticRenderFns__ = [];
253
253
 
254
254
  const __vue_inject_styles__ = function (inject) {
255
255
  if (!inject) return;
256
- inject("data-v-942c8fea_0", {
256
+ inject("data-v-183ac2ec_0", {
257
257
  source: "@font-face{font-family:icomoon;src:url(fonts/icomoon.eot?5gakus);src:url(fonts/icomoon.eot?5gakus#iefix) format('embedded-opentype'),url(fonts/icomoon.ttf?5gakus) format('truetype'),url(fonts/icomoon.woff?5gakus) format('woff'),url(fonts/icomoon.svg?5gakus#icomoon) format('svg');font-weight:400;font-style:normal;font-display:block}[class*=\" icon-\"],[class^=icon-]{font-family:icomoon!important;speak:never;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-coffee:before{content:\"\\e900\"}.icon-moon:before{content:\"\\e901\"}.icon-sun:before{content:\"\\e902\"}:root{--app-background-color:#ffffff;--app-title-color:#333333;--app-subtitle-color:#555555}[theme=dark]{--app-background-color:#333333;--app-title-color:#ffffff;--app-subtitle-color:#dddddd}[theme=sepia]{--app-background-color:#d0bc91;--app-title-color:#8a6c44;--app-subtitle-color:#5f4938}.app-background{background-color:var(--app-background-color)}.app-title{color:var(--app-title-color)}.app-subtitle{color:var(--app-subtitle-color);padding-top:10px}.change-theme-box{cursor:pointer;color:var(--app-subtitle-color);font-size:1em;font-weight:400}",
258
258
  map: undefined,
259
259
  media: undefined
@@ -1 +1 @@
1
- var VueMultipleThemes=function(e){"use strict";var t={name:"VueMultipleThemes",props:{defaultTheme:{default:"light",type:String},themeColorList:{default:function(){return["light","dark","sepia"]},type:Array},extraClass:{default:"",type:String},changeThemeOff:{default:!0,type:Boolean}},data:function(){return{theme:this.defaultTheme,counter:0,themeName:this.defaultTheme,showChangeTheme:this.changeThemeOff}},computed:{showChangeThemeHandler:function(){this.showChangeTheme||(this.theme=this.defaultTheme,this.themeName=this.theme,this.themeColor(this.theme))}},methods:{themeColor:function(e){this.theme="".concat(e),document.title="Multiple Themes in Vue.js",document.body.classList.add("app-background"),document.documentElement.setAttribute("theme","".concat(e)),localStorage.setItem("theme",JSON.stringify("".concat(e)))},changeTheme:function(){this.counter=this.counter+1,this.counter===this.themeColorList.length&&(this.counter=0),this.themeName=this.themeColorList[this.counter],this.themeColor(this.themeName)}},mounted:function(){(this.showChangeTheme||this.showChangeThemeHandler(),localStorage.getItem("theme")&&this.showChangeTheme)?(this.theme=JSON.parse(localStorage.getItem("theme")),document.documentElement.setAttribute("theme",this.theme),this.themeName=this.theme,this.themeColor(this.theme)):(this.theme=this.defaultTheme,this.themeName=this.theme,this.themeColor(this.theme))}};function o(e,t,o,n,s,i,a,l,r,c){"boolean"!=typeof a&&(r=l,l=a,a=!1);const h="function"==typeof o?o.options:o;let m;if(e&&e.render&&(h.render=e.render,h.staticRenderFns=e.staticRenderFns,h._compiled=!0,s&&(h.functional=!0)),n&&(h._scopeId=n),i?(m=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,r(e)),e&&e._registeredComponents&&e._registeredComponents.add(i)},h._ssrRegister=m):t&&(m=a?function(e){t.call(this,c(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,l(e))}),m)if(h.functional){const e=h.render;h.render=function(t,o){return m.call(o),e(t,o)}}else{const e=h.beforeCreate;h.beforeCreate=e?[].concat(e,m):[m]}return o}const n="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function s(e){return(e,t)=>function(e,t){const o=n?t.media||"default":e,s=a[o]||(a[o]={ids:new Set,styles:[]});if(!s.ids.has(e)){s.ids.add(e);let o=t.source;if(t.map&&(o+="\n/*# sourceURL="+t.map.sources[0]+" */",o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t.map))))+" */"),s.element||(s.element=document.createElement("style"),s.element.type="text/css",t.media&&s.element.setAttribute("media",t.media),void 0===i&&(i=document.head||document.getElementsByTagName("head")[0]),i.appendChild(s.element)),"styleSheet"in s.element)s.styles.push(o),s.element.styleSheet.cssText=s.styles.filter(Boolean).join("\n");else{const e=s.ids.size-1,t=document.createTextNode(o),n=s.element.childNodes;n[e]&&s.element.removeChild(n[e]),n.length?s.element.insertBefore(t,n[e]):s.element.appendChild(t)}}}(e,t)}let i;const a={};var l=o({render:function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"vue-multiple-themes",class:e.extraClass},[e.changeThemeOff?o("span",{staticClass:"change-theme-box",on:{click:function(t){return e.changeTheme()}}},["dark"===e.themeName?o("span",{staticClass:"icon-moon"}):e._e(),e._v(" "),"light"===e.themeName?o("span",{staticClass:"icon-sun"}):e._e(),e._v(" "),"sepia"===e.themeName?o("span",{staticClass:"icon-coffee"}):e._e()]):e._e()])},staticRenderFns:[]},(function(e){e&&e("data-v-942c8fea_0",{source:"@font-face{font-family:icomoon;src:url(fonts/icomoon.eot?5gakus);src:url(fonts/icomoon.eot?5gakus#iefix) format('embedded-opentype'),url(fonts/icomoon.ttf?5gakus) format('truetype'),url(fonts/icomoon.woff?5gakus) format('woff'),url(fonts/icomoon.svg?5gakus#icomoon) format('svg');font-weight:400;font-style:normal;font-display:block}[class*=\" icon-\"],[class^=icon-]{font-family:icomoon!important;speak:never;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-coffee:before{content:\"\\e900\"}.icon-moon:before{content:\"\\e901\"}.icon-sun:before{content:\"\\e902\"}:root{--app-background-color:#ffffff;--app-title-color:#333333;--app-subtitle-color:#555555}[theme=dark]{--app-background-color:#333333;--app-title-color:#ffffff;--app-subtitle-color:#dddddd}[theme=sepia]{--app-background-color:#d0bc91;--app-title-color:#8a6c44;--app-subtitle-color:#5f4938}.app-background{background-color:var(--app-background-color)}.app-title{color:var(--app-title-color)}.app-subtitle{color:var(--app-subtitle-color);padding-top:10px}.change-theme-box{cursor:pointer;color:var(--app-subtitle-color);font-size:1em;font-weight:400}",map:void 0,media:void 0})}),t,void 0,!1,void 0,!1,s,void 0,void 0),r=function(e){r.installed||(r.installed=!0,e.component("VueMultipleThemes",l))},c={install:r},h=null;return"undefined"!=typeof window?h=window.Vue:"undefined"!=typeof global&&(h=global.Vue),h&&h.use(c),l.install=r,e.default=l,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
1
+ var VueMultipleThemes=function(e){"use strict";var t={name:"VueMultipleThemes",props:{defaultTheme:{default:"light",type:String},themeColorList:{default:function(){return["light","dark","sepia"]},type:Array},extraClass:{default:"",type:String},changeThemeOff:{default:!0,type:Boolean}},data:function(){return{theme:this.defaultTheme,counter:0,themeName:this.defaultTheme,showChangeTheme:this.changeThemeOff}},computed:{showChangeThemeHandler:function(){this.showChangeTheme||(this.theme=this.defaultTheme,this.themeName=this.theme,this.themeColor(this.theme))}},methods:{themeColor:function(e){this.theme="".concat(e),document.title="Multiple Themes in Vue.js",document.body.classList.add("app-background"),document.documentElement.setAttribute("theme","".concat(e)),localStorage.setItem("theme",JSON.stringify("".concat(e)))},changeTheme:function(){this.counter=this.counter+1,this.counter===this.themeColorList.length&&(this.counter=0),this.themeName=this.themeColorList[this.counter],this.themeColor(this.themeName)}},mounted:function(){(this.showChangeTheme||this.showChangeThemeHandler(),localStorage.getItem("theme")&&this.showChangeTheme)?(this.theme=JSON.parse(localStorage.getItem("theme")),document.documentElement.setAttribute("theme",this.theme),this.themeName=this.theme,this.themeColor(this.theme)):(this.theme=this.defaultTheme,this.themeName=this.theme,this.themeColor(this.theme))}};function o(e,t,o,n,s,i,a,l,r,c){"boolean"!=typeof a&&(r=l,l=a,a=!1);const h="function"==typeof o?o.options:o;let m;if(e&&e.render&&(h.render=e.render,h.staticRenderFns=e.staticRenderFns,h._compiled=!0,s&&(h.functional=!0)),n&&(h._scopeId=n),i?(m=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,r(e)),e&&e._registeredComponents&&e._registeredComponents.add(i)},h._ssrRegister=m):t&&(m=a?function(e){t.call(this,c(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,l(e))}),m)if(h.functional){const e=h.render;h.render=function(t,o){return m.call(o),e(t,o)}}else{const e=h.beforeCreate;h.beforeCreate=e?[].concat(e,m):[m]}return o}const n="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function s(e){return(e,t)=>function(e,t){const o=n?t.media||"default":e,s=a[o]||(a[o]={ids:new Set,styles:[]});if(!s.ids.has(e)){s.ids.add(e);let o=t.source;if(t.map&&(o+="\n/*# sourceURL="+t.map.sources[0]+" */",o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t.map))))+" */"),s.element||(s.element=document.createElement("style"),s.element.type="text/css",t.media&&s.element.setAttribute("media",t.media),void 0===i&&(i=document.head||document.getElementsByTagName("head")[0]),i.appendChild(s.element)),"styleSheet"in s.element)s.styles.push(o),s.element.styleSheet.cssText=s.styles.filter(Boolean).join("\n");else{const e=s.ids.size-1,t=document.createTextNode(o),n=s.element.childNodes;n[e]&&s.element.removeChild(n[e]),n.length?s.element.insertBefore(t,n[e]):s.element.appendChild(t)}}}(e,t)}let i;const a={};var l=o({render:function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"vue-multiple-themes",class:e.extraClass},[e.changeThemeOff?o("span",{staticClass:"change-theme-box",on:{click:function(t){return e.changeTheme()}}},["dark"===e.themeName?o("span",{staticClass:"icon-moon"}):e._e(),e._v(" "),"light"===e.themeName?o("span",{staticClass:"icon-sun"}):e._e(),e._v(" "),"sepia"===e.themeName?o("span",{staticClass:"icon-coffee"}):e._e()]):e._e()])},staticRenderFns:[]},(function(e){e&&e("data-v-183ac2ec_0",{source:"@font-face{font-family:icomoon;src:url(fonts/icomoon.eot?5gakus);src:url(fonts/icomoon.eot?5gakus#iefix) format('embedded-opentype'),url(fonts/icomoon.ttf?5gakus) format('truetype'),url(fonts/icomoon.woff?5gakus) format('woff'),url(fonts/icomoon.svg?5gakus#icomoon) format('svg');font-weight:400;font-style:normal;font-display:block}[class*=\" icon-\"],[class^=icon-]{font-family:icomoon!important;speak:never;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-coffee:before{content:\"\\e900\"}.icon-moon:before{content:\"\\e901\"}.icon-sun:before{content:\"\\e902\"}:root{--app-background-color:#ffffff;--app-title-color:#333333;--app-subtitle-color:#555555}[theme=dark]{--app-background-color:#333333;--app-title-color:#ffffff;--app-subtitle-color:#dddddd}[theme=sepia]{--app-background-color:#d0bc91;--app-title-color:#8a6c44;--app-subtitle-color:#5f4938}.app-background{background-color:var(--app-background-color)}.app-title{color:var(--app-title-color)}.app-subtitle{color:var(--app-subtitle-color);padding-top:10px}.change-theme-box{cursor:pointer;color:var(--app-subtitle-color);font-size:1em;font-weight:400}",map:void 0,media:void 0})}),t,void 0,!1,void 0,!1,s,void 0,void 0),r=function(e){r.installed||(r.installed=!0,e.component("VueMultipleThemes",l))},c={install:r},h=null;return"undefined"!=typeof window?h=window.Vue:"undefined"!=typeof global&&(h=global.Vue),h&&h.use(c),l.install=r,e.default=l,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
@@ -218,7 +218,7 @@ var __vue_staticRenderFns__ = [];
218
218
 
219
219
  var __vue_inject_styles__ = function __vue_inject_styles__(inject) {
220
220
  if (!inject) return;
221
- inject("data-v-942c8fea_0", {
221
+ inject("data-v-183ac2ec_0", {
222
222
  source: "@font-face{font-family:icomoon;src:url(fonts/icomoon.eot?5gakus);src:url(fonts/icomoon.eot?5gakus#iefix) format('embedded-opentype'),url(fonts/icomoon.ttf?5gakus) format('truetype'),url(fonts/icomoon.woff?5gakus) format('woff'),url(fonts/icomoon.svg?5gakus#icomoon) format('svg');font-weight:400;font-style:normal;font-display:block}[class*=\" icon-\"],[class^=icon-]{font-family:icomoon!important;speak:never;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-coffee:before{content:\"\\e900\"}.icon-moon:before{content:\"\\e901\"}.icon-sun:before{content:\"\\e902\"}:root{--app-background-color:#ffffff;--app-title-color:#333333;--app-subtitle-color:#555555}[theme=dark]{--app-background-color:#333333;--app-title-color:#ffffff;--app-subtitle-color:#dddddd}[theme=sepia]{--app-background-color:#d0bc91;--app-title-color:#8a6c44;--app-subtitle-color:#5f4938}.app-background{background-color:var(--app-background-color)}.app-title{color:var(--app-title-color)}.app-subtitle{color:var(--app-subtitle-color);padding-top:10px}.change-theme-box{cursor:pointer;color:var(--app-subtitle-color);font-size:1em;font-weight:400}",
223
223
  map: undefined,
224
224
  media: undefined
@@ -230,7 +230,7 @@ var __vue_inject_styles__ = function __vue_inject_styles__(inject) {
230
230
  var __vue_scope_id__ = undefined;
231
231
  /* module identifier */
232
232
 
233
- var __vue_module_identifier__ = "data-v-942c8fea";
233
+ var __vue_module_identifier__ = "data-v-183ac2ec";
234
234
  /* functional template */
235
235
 
236
236
  var __vue_is_functional_template__ = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-multiple-themes",
3
- "version": "1.3.0",
3
+ "version": "1.5.1",
4
4
  "description": "Vue Multiple Themes",
5
5
  "author": "Pooya Golchian(pooya.golchian@gmail.com)",
6
6
  "main": "dist/vue-multiple-themes.ssr.js",
package/readme.md CHANGED
@@ -4,6 +4,11 @@
4
4
 
5
5
  2- Easy to use and add themes (Color Plallet)
6
6
 
7
+ ---
8
+
9
+ ## Demo
10
+ - [Demo of Vue Multiple Theme package](https://vuemultipletheme.netlify.app/)
11
+
7
12
  ![vue-multiple-themes](vue-multiple-themes.gif)
8
13
 
9
14
  ### Install package
@@ -84,6 +89,11 @@ After import and register component in your Vue.js application:
84
89
  }
85
90
  ```
86
91
 
92
+
93
+ ---
94
+ ### Icon font issue
95
+ **You need add fonts to your public project folder**
96
+
87
97
  ## Documents
88
98
 
89
99
  | Attribute | Description | Type | Default |
@@ -97,7 +97,7 @@ export default {
97
97
  }
98
98
 
99
99
  [class^="icon-"], [class*=" icon-"] {
100
- /* use !important to prevent issues with browser extensions that change ./fonts */
100
+ /* use !important to prevent issues with browser extensions that change fonts */
101
101
  font-family: 'icomoon' !important;
102
102
  speak: never;
103
103
  font-style: normal;