Skip to content

Commit 2fd701d

Browse files
MonsieurVAdeleD
andauthored
Add an example CSS (basic) theme (#472)
* Let web target be implied, else it will includes require in react-refresh build * Add an example theme * Update theme/basic/README.md Co-authored-by: AdeleD <adele.delamarche@gmail.com> * Update theme/basic/README.md Co-authored-by: AdeleD <adele.delamarche@gmail.com> --------- Co-authored-by: AdeleD <adele.delamarche@gmail.com>
1 parent c2c27ca commit 2fd701d

File tree

4 files changed

+64
-6
lines changed

4 files changed

+64
-6
lines changed

demo/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const isDevelopment = process.env.NODE_ENV !== 'production';
1212
console.log(`Webpack demo ${isDevelopment ? 'dev' : 'prod'}`);
1313

1414
module.exports = {
15-
target: 'node',
1615
entry: [
1716
'webpack-hot-middleware/client',
1817
path.resolve(dir_demo_js, 'demo.js'),
@@ -35,6 +34,7 @@ module.exports = {
3534
rules: [
3635
{
3736
test: dir_demo_js,
37+
// test: /\.js?$/,
3838
exclude: /node_modules/,
3939
use: [
4040
{

theme/basic/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Basic CSS theme
2+
3+
## How to use it
4+
5+
Add the `theme/basic/react-paginatte.css` file to your HTML page. For eg., after downloading it and making it available on your server as `/assets/css/react-paginate.css`:
6+
7+
```html
8+
<link href="/assets/css/react-paginate.css" rel="stylesheet" />
9+
```
10+
11+
Then load the `ReactPaginate` component by specifying the `className` prop to `react-paginate`. This will add the class to the `<ul>` container:
12+
13+
```javascript
14+
import ReactPaginate from 'react-paginate';
15+
16+
17+
function MyExampleApp() {
18+
// Manage offsets, page clicks, etc. ... (See main README.md)
19+
20+
return (
21+
<>
22+
<h2>Paginated page</h2>
23+
<ReactPaginate
24+
className="react-paginate"
25+
// ...
26+
/>
27+
</>
28+
);
29+
}
30+
```

theme/basic/react-paginate.css

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
ul.react-paginate {
2+
margin-bottom: 2rem;
3+
display: flex;
4+
flex-direction: row;
5+
justify-content: space-between;
6+
list-style-type: none;
7+
padding: 0 5rem;
8+
}
9+
10+
ul.react-paginate li a {
11+
border-radius: 7px;
12+
padding: 0.1rem 1rem;
13+
border: gray 1px solid;
14+
cursor: pointer;
15+
}
16+
ul.react-paginate li.previous a,
17+
ul.react-paginate li.next a,
18+
ul.react-paginate li.break a {
19+
border-color: transparent;
20+
}
21+
ul.react-paginate li.selected a {
22+
background-color: #0366d6;
23+
border-color: transparent;
24+
color: white;
25+
min-width: 32px;
26+
}
27+
ul.react-paginate li.disabled a {
28+
color: grey;
29+
}
30+
ul.react-paginate li.disable,
31+
ul.react-paginate li.disabled a {
32+
cursor: default;
33+
}

webpack.config.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@ const config = {
2323
},
2424
module: {
2525
rules: [
26-
// {
27-
// use: 'react-hot-loader/webpack',
28-
// test: dir_js,
29-
// exclude: dir_node_modules,
30-
// },
3126
{
3227
use: 'babel-loader',
3328
test: dir_js,

0 commit comments

Comments
 (0)