Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.

Commit b924e57

Browse files
committed
feat: bootstrap theme
1 parent 266db21 commit b924e57

File tree

7 files changed

+18
-10
lines changed

7 files changed

+18
-10
lines changed

examples/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import ToastPlugin from '../src/index';
55

66
import 'bootstrap/dist/css/bootstrap.min.css';
77
//import '../src/themes/default/index.scss'
8-
import '../src/themes/sugar/index.scss'
8+
import '../src/themes/bootstrap/index.scss'
99

1010
import App from './App.vue';
1111

src/themes/bootstrap/_variables.scss

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$toast-icons-path: "../sugar/icons" !default;

src/themes/bootstrap/index.scss

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@import '../default/variables';
2+
@import 'variables';
3+
@import '../animations';
4+
@import '../default/main';
5+
@import '../sugar/icons';

src/themes/sugar/_variables.scss

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
$toast-icons-path: "./icons" !default;
12
$toast-colors: () !default;
23
$toast-colors: map-merge(
34
(

src/themes/sugar/icons.scss

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
min-width: 27px;
1414
height: 27px;
1515
margin-left: 1em;
16-
background: url(./icons/info.svg) no-repeat;
16+
background: url(#{$toast-icons-path}/info.svg) no-repeat;
1717

1818
[dir="rtl"] & {
1919
margin-left: unset;
@@ -22,15 +22,15 @@
2222
}
2323

2424
&.v-toast__item--success .v-toast__icon {
25-
background: url(./icons/success.svg) no-repeat;
25+
background: url(#{$toast-icons-path}/success.svg) no-repeat;
2626
}
2727

2828
&.v-toast__item--error .v-toast__icon {
29-
background: url(./icons/error.svg) no-repeat;
29+
background: url(#{$toast-icons-path}/error.svg) no-repeat;
3030
}
3131

3232
&.v-toast__item--warning .v-toast__icon {
33-
background: url(./icons/warning.svg) no-repeat;
33+
background: url(#{$toast-icons-path}/warning.svg) no-repeat;
3434
}
3535
}
3636
}

webpack.config.dev.js

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ module.exports = {
1919
alias: {
2020
vue: "@vue/runtime-dom"
2121
},
22-
extensions: ['.js', '.jsx', '.json', '.vue'],
2322
},
2423
entry: './examples/index.js',
2524
output: {

webpack.config.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ module.exports = {
1616
alias: {
1717
'vue$': 'vue/dist/vue.runtime.esm.js'
1818
},
19-
extensions: ['.js', '.json', '.vue']
2019
},
2120
entry: {
2221
index: './src/index.js',
2322
'index.min': './src/index.js',
23+
'theme-bootstrap': './src/themes/bootstrap/index.scss',
2424
'theme-default': './src/themes/default/index.scss',
2525
'theme-sugar': './src/themes/sugar/index.scss',
2626
},
@@ -36,9 +36,11 @@ module.exports = {
3636
clean: true,
3737
path: path.resolve(__dirname, 'dist'),
3838
filename: '[name].js',
39-
library: 'VueToast',
40-
libraryTarget: 'umd',
41-
umdNamedDefine: true,
39+
library: {
40+
name: 'VueToast',
41+
type: 'umd',
42+
umdNamedDefine: true,
43+
},
4244
globalObject: 'this',
4345
pathinfo: false
4446
},

0 commit comments

Comments
 (0)