Skip to content

Commit

Permalink
Merge pull request #11 from uxcore/xijia
Browse files Browse the repository at this point in the history
支持样式隔离
  • Loading branch information
eternalsky committed Sep 14, 2018
2 parents 8e881e0 + 7c2eb38 commit d80fb63
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ spm_modules
dist
build
assets/**/*.css
coverage
package-lock.json
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3.8

`CHANGED` support js style export

## 0.3.7

`CHANGED` React 15.x compatibility
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@
},
"contributors": [],
"license": "MIT"
}
}
12 changes: 7 additions & 5 deletions src/Carousel.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
*/

// Default Variables
@__carouselPrefixCls: kuma-carousel;

@slick-font-path: "./fonts/";
@slick-font-family: "kuma";
@slick-loader-path: "./";
Expand All @@ -20,8 +22,8 @@
@slick-opacity-default: 1;
@slick-opacity-on-hover: 1;
@slick-opacity-not-active: 0.75;
@carouselPrefixCls: kuma-carousel;
.@{carouselPrefixCls} {

.@{__carouselPrefixCls} {
&:hover {
.slick-prev,
.slick-next {
Expand Down Expand Up @@ -257,21 +259,21 @@
}
}

.@{carouselPrefixCls}-always-show-arrows {
.@{__carouselPrefixCls}-always-show-arrows {
/* Arrows */
.slick-prev,
.slick-next {
opacity: 1;
}
}

.@{carouselPrefixCls}-dots-centered {
.@{__carouselPrefixCls}-dots-centered {
.slick-dots {
text-align: center;
}
}

.@{carouselPrefixCls}-large-mode {
.@{__carouselPrefixCls}-large-mode {
.slick-prev,
.slick-next {
width: 36px;
Expand Down
1 change: 1 addition & 0 deletions style/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '../src/Carousel.less';
19 changes: 19 additions & 0 deletions webpack.custom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const modifyVars = require('kuma-base/jsvars/orange');

/* eslint-disable no-param-reassign */
module.exports = (config) => {
config.module.rules.forEach((rule) => {
if (rule.test.toString() === /\.less$/.toString()) {
rule.use = [
'style-loader',
'css-loader',
{
loader: 'less-loader',
options: {
modifyVars,
},
},
];
}
});
};

0 comments on commit d80fb63

Please sign in to comment.