question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extend group style from sidebars to horizontal lines

See original GitHub issue

New developer here, I am able to style the left and right sidebars, how do you extend this to the middle of the calendar? Thanks

groupRenderer = ({group}) => {
  let bgColor = 'white'
  
  if (group.root == true) {
    bgColor = 'lightgray'
  }
  return (
    <div style={{backgroundColor:bgColor}}></div>
  )
}

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
trevdorcommented, Jul 22, 2019

@Ilaiwi I thought the groupRenderer could only affect the content in the sidebar? Here, we’re trying to style the areas in .rct-scroll or perhaps .rct-horizontal-lines. Can groupRenderer modify those?

2reactions
trevdorcommented, Jul 9, 2019

I attempted to implement consistent row coloring across groups in the sidebar and through the timeline scroll area in this codesandbox in case it might help @capt-obvious or anyone else to settle this question.

For the demo, I apply a “highlight” class (provides the bright green background) to groups whose titles include the letter ‘e’ (could use any criteria, of course) The same class is applied to group headers in the groupRenderer. Then I add styling for that class in style.css.

Screen Shot 2019-07-05 at 3 29 02 PM

If anyone has a chance to look at my sandbox (maybe @perfectstrong or @Ilaiwi?), I’m curious if there’s a better way to do this.

Seems like it might be helpful for the classNames returned from horizontalLineClassNamesForGroup to be applied to the Sidebar group rows as well. (Right now, I have to override some rct styles to get the custom rendered group to fill the entire sidebar because I don’t know of a way to apply a className to the sidebar div with classNames rct-sidebar-row rct-sidebar-row-[even|odd].)

Applying those classNames to the Sidebar rows could look like this: https://github.com/trevdor/react-calendar-timeline/pull/1/files#diff-d3d66df219d3e1cc2a8b662759fa30adR64

Read more comments on GitHub >

github_iconTop Results From Across the Web

Horizontal Line Styling on Each Side of Titles - Stack Overflow
In the blog above, titles in the sidebar, and the 'share this article' title has the desired effect that I am looking for,...
Read more >
CSS Sidebars: A Beginner's Guide - HubSpot Blog
Learn how to code your own website sidebar using CSS and HTML. We'll explain static, fixed, sticky, grid, and collapsible sidebars and how ......
Read more >
The Divi Sidebar Module | Elegant Themes Documentation
The “insert module” area represents your vertical sidebar. This is where you will enter the Sidebar Module. You can add as many modules...
Read more >
How To Style the HR Element with CSS - W3Schools
Learn how to style an hr element with CSS. How To Style HR. Horizontal Line. You can use the border property to style...
Read more >
Add borders and rules (lines) in Pages on Mac - Apple Support
Click the Style tab at the top of the sidebar on the right, then click the pop-up menu to the right of Border,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found