Skip to content

Commit 884bece

Browse files
cutterbljquense
authored andcommitted
feat: switch to Sass for styles
BREAKING CHANGE: Less files have been replaced with Sass versions
1 parent 5d9a16f commit 884bece

27 files changed

+12960
-11827
lines changed

.size-snapshot.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
{
22
"./dist/react-big-calendar.js": {
3-
"bundled": 561388,
4-
"minified": 171351,
5-
"gzipped": 50367
3+
"bundled": 561648,
4+
"minified": 171367,
5+
"gzipped": 50382
66
},
77
"./dist/react-big-calendar.min.js": {
8-
"bundled": 497725,
9-
"minified": 152002,
10-
"gzipped": 45855
8+
"bundled": 497985,
9+
"minified": 152018,
10+
"gzipped": 45872
1111
},
1212
"dist/react-big-calendar.esm.js": {
13-
"bundled": 169329,
14-
"minified": 81452,
15-
"gzipped": 20069,
13+
"bundled": 169583,
14+
"minified": 81478,
15+
"gzipped": 20083,
1616
"treeshaked": {
1717
"rollup": {
18-
"code": 62945,
18+
"code": 62961,
1919
"import_statements": 1466
2020
},
2121
"webpack": {
22-
"code": 66463
22+
"code": 66479
2323
}
2424
}
2525
}

.storybook/webpack.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { rules } = require('webpack-atoms')
1+
const { rules, loaders, plugins, stats } = require('webpack-atoms')
22

33
const browsers = ['last 2 versions', 'ie >= 10']
44

@@ -8,7 +8,7 @@ module.exports = function({ config }) {
88
rules.fonts(),
99
rules.images(),
1010
rules.css(),
11-
rules.less({ browsers }),
11+
rules.sass({ browsers }),
1212
]
1313

1414
return config

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Inspired by [Full Calendar](http://fullcalendar.io/).
1111
`yarn add react-big-calendar` or `npm install --save react-big-calendar`
1212

1313
Include `react-big-calendar/lib/css/react-big-calendar.css` for styles, and make sure your calendar's container
14-
element has a height, or the calendar won't be visible.
14+
element has a height, or the calendar won't be visible. To provide your own custom styling, see the [Custom Styling](#custom-styling) topic.
1515

1616
## Starters
1717

@@ -76,6 +76,20 @@ const MyCalendar = props => (
7676
)
7777
```
7878

79+
## Custom Styling
80+
81+
Out of the box you can include the compiled css files and be up and running. But, sometimes, you may want to style
82+
Big Calendar to match your application styling. For this reason SASS files are included with Big Calendar.
83+
84+
```
85+
@import 'react-big-calendar/lib/sass/styles';
86+
@import 'react-big-calendar/addons/dragAndDrop/styles'; // if using DnD
87+
```
88+
89+
SASS implementation provides a `variables` file containing color and sizing variables that you can
90+
update to fit your application. _Note:_ Changing and/or overriding styles can cause rendering issues with your
91+
Big Calendar. Carefully test each change accordingly.
92+
7993
## Join us on Reactiflux Discord
8094

8195
Join us on [Reactiflux Discord](https://discord.gg/uJsgpkC) community under the channel #react-big-calendar if you have any questions.

examples/App.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import globalize from 'globalize'
1010
import 'bootstrap/dist/css/bootstrap.min.css'
1111
import 'font-awesome/css/font-awesome.min.css'
1212

13-
import 'react-big-calendar/lib/less/styles.less'
14-
import './styles.less'
15-
import './prism.less'
13+
import 'react-big-calendar/lib/sass/styles.scss'
14+
import './styles.scss'
15+
import './prism.scss'
1616
import Card from './Card'
1717
import ExampleControlSlot from './ExampleControlSlot'
1818
import Basic from './demos/basic'

examples/Intro.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ _yarn:_ `yarn add react-big-calendar`
77
_npm:_ `npm install --save react-big-calendar`
88

99
Styles can be found at: `react-big-calendar/lib/css/react-big-calendar.css`, and should be included on the page
10-
with the calendar component. Also make sure that your calendar's container
10+
with the calendar component. Alternatively, you can include the styles directly in your SASS build. See the [Custom Styling](https://github.com/intljusticemission/react-big-calendar/blob/master/README.md#custom-styling) section of the README file for more details.
11+
12+
Also make sure that your calendar's container
1113
element has a height, or the calendar won't be visible (see why below).
1214

1315
Date internationalization and localization is **hard** and `react-big-calendar` doesn't even attempt to

0 commit comments

Comments
 (0)