Skip to content

Commit

Permalink
feat(slider): allow overriding css classes from a user stylesheet
Browse files Browse the repository at this point in the history
We now use our style-loader fork to be able to `prepend` a component
`<style>` instead of appending it to the `<head>`.

So that we can now override component style from a stylesheet in the
html page.
  • Loading branch information
vvo committed Sep 15, 2015
1 parent 6c346c4 commit a1e87dd
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion components/Slider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var React = require('react');

var Nouislider = require('react-nouislider');

require('./index.css');
require('style?prepend!raw!./index.css');

var cssPrefix = 'as-range-slider--';

Expand Down
2 changes: 0 additions & 2 deletions example/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require('./style.css');

var instantsearch = require('../');

var search = instantsearch({
Expand Down
1 change: 1 addition & 0 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<title>Instant search demo built with instantsearch.js</title>
<link rel="stylesheet" href="//cdn.jsdelivr.net/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="./style.css">
</head>
<body>
<div class="container">
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
"babel-eslint": "4.1.1",
"babel-loader": "5.3.2",
"babel-tape-runner": "1.2.0",
"css-loader": "0.16.0",
"raw-loader": "0.5.1",
"doctoc": "0.15.0",
"eslint": "1.4.1",
"eslint-config-airbnb": "0.0.8",
Expand All @@ -39,8 +37,9 @@
"onchange": "2.0.0",
"pretty-bytes": "2.0.1",
"proxyquire": "1.7.1",
"raw-loader": "0.5.1",
"sinon": "1.16.1",
"style-loader": "0.12.3",
"style-loader": "algolia/style-loader#3ec5a83b23607339e25fe65d51ae823ba9a8e7df",
"tap-spec": "4.1.0",
"tape": "4.2.0",
"uglifyjs": "2.4.10",
Expand Down
2 changes: 0 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ module.exports = {
test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader'
}, {
test: /\.html$/, exclude: /node_modules/, loader: 'raw'
}, {
test: /\.css$/, loader: 'style-loader!css-loader'
}]
}
};
2 changes: 0 additions & 2 deletions webpack.example.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ module.exports = {
test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader'
}, {
test: /\.html$/, exclude: /node_modules/, loader: 'raw'
}, {
test: /\.css$/, loader: 'style-loader!css-loader'
}]
},
devServer: {
Expand Down

0 comments on commit a1e87dd

Please sign in to comment.