Skip to content

Commit e194335

Browse files
committed
removed scss import from library code. updated readme and changelog
1 parent 8f47e86 commit e194335

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ and this project adheres (more or less) to [Semantic Versioning](http://semver.o
1818
### Breaking
1919

2020
* removed `fixedHeader` prop in favor of using `position: sticky` by default
21+
* removed import of stylesheets in library code, put onus on user to handle this stylesheet
2122

2223
### Fixed
2324

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ At the very minimum:
3636

3737
```jsx
3838
import Timeline from 'react-calendar-timeline'
39+
// make sure you include the timeline stylesheet or the timeline will not be styled
40+
import 'react-calender-timeline/lib/Timeline.css'
3941
import moment from 'moment'
4042

4143
const groups = [{ id: 1, title: 'group 1' }, { id: 2, title: 'group 2' }]
@@ -557,6 +559,10 @@ The children gets passed the following props:
557559

558560
## FAQ
559561

562+
### My timeline is unstyled
563+
564+
You need to include the `Timeline.css` file, either via static file reference or webpack stylesheet bundling. The file is located at `lib/Timeline.css`
565+
560566
### How can I have items with different colors?
561567

562568
[Items](https://github.com/namespace-ee/react-calendar-timeline#items) have a "className" parameter. For example if you have "standard" items and "analysis" items, then you can just add an "analysis" class for your analysis items and then change the css backgroundColor property for them.

demo/index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import React from 'react'
22
import ReactDOM from 'react-dom'
3+
import 'react-calendar-timeline-css'
34
import App from './app'
45

56
import './index.html'
67

7-
const render = (AppToRender) => {
8-
ReactDOM.render(
9-
<AppToRender />,
10-
document.getElementById('root')
11-
)
8+
const render = AppToRender => {
9+
ReactDOM.render(<AppToRender />, document.getElementById('root'))
1210
}
1311

1412
render(App)

src/lib/Timeline.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import PropTypes from 'prop-types'
22
import React, { Component } from 'react'
33
import moment from 'moment'
4-
import './Timeline.scss'
54

65
import Items from './items/Items'
76
import InfoLabel from './layout/InfoLabel'

webpack.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ const config = {
5959
modules: [path.resolve('./demo'), 'node_modules'],
6060
alias: {
6161
'~': path.join(__dirname, './demo'),
62-
'react-calendar-timeline': path.join(__dirname, './src')
62+
'react-calendar-timeline': path.join(__dirname, './src'),
63+
'react-calendar-timeline-css': path.join(
64+
__dirname,
65+
'./src/lib/Timeline.scss'
66+
)
6367
}
6468
},
6569
plugins: [

0 commit comments

Comments
 (0)