Skip to content

Commit a20eaf5

Browse files
committed
Added IE support (with default width & height)
1 parent e7656ac commit a20eaf5

File tree

5 files changed

+31
-9
lines changed

5 files changed

+31
-9
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ssr.index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"css-loader": "^0.25.0",
3434
"file-loader": "^0.9.0",
3535
"node-sass": "^4.5.0",
36+
"optimize-css-assets-webpack-plugin": "^3.1.1",
3637
"sass-loader": "^5.0.1",
3738
"vue": "^2.0.0",
3839
"vue-loader": "^11.1.4",

src/Button.vue

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ export default {
156156

157157
<style lang="scss" scoped>
158158
$height: 22px;
159+
$width: 50px;
160+
159161
$margin: 3px;
160162
// $core-size: $height - 2 * $margin;
161163
@@ -232,12 +234,6 @@ $margin: 3px;
232234
}
233235
}
234236
235-
&.toggled {
236-
.v-switch-core:before {
237-
transform: translate(30px, $margin);
238-
transform: translate(var(--d), $margin);
239-
}
240-
}
241237
242238
&.disabled {
243239
pointer-events: none;
@@ -247,24 +243,43 @@ $margin: 3px;
247243
}
248244
249245
.vue-js-switch {
246+
line-height: $height;
247+
height: $height;
248+
250249
line-height: var(--h);
251250
height: var(--h);
252251
253252
.v-switch-label {
253+
line-height: $height;
254+
height: $height;
255+
254256
line-height: var(--h);
255257
height: var(--h);
256258
}
257259
258260
.v-switch-core {
259261
border-radius: 999px;
260-
width: 50px;
262+
263+
width: $width;
264+
height: $height;
265+
261266
width: var(--w);
262267
height: var(--h);
263268
264269
&:before {
270+
width: calc(#{$height} - 6px);
271+
height: calc(#{$height} - 6px);
272+
265273
width: calc(var(--h) - 6px);
266274
height: calc(var(--h) - 6px);
267275
}
268276
}
277+
278+
&.toggled {
279+
.v-switch-core:before {
280+
transform: translate(30px, $margin);
281+
transform: translate(var(--d), $margin);
282+
}
283+
}
269284
}
270285
</style>

webpack.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var path = require('path')
22
var webpack = require('webpack')
3+
var OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
34

45
module.exports = {
56
entry: './src/index.js',
@@ -43,6 +44,11 @@ module.exports = {
4344
plugins: [
4445
new webpack.LoaderOptionsPlugin({
4546
minimize: true
47+
}),
48+
new OptimizeCSSPlugin({
49+
cssProcessorOptions: {
50+
safe: true
51+
}
4652
})
4753
]
4854
}

0 commit comments

Comments
 (0)