Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持样式隔离 #11

Merged
merged 2 commits into from
Sep 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
},
},
];
}
});
};