Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add modifiers classes to cell elements #1856

Open
gpbl opened this issue Jul 31, 2023 Discussed in #1855 · 1 comment
Open

Add modifiers classes to cell elements #1856

gpbl opened this issue Jul 31, 2023 Discussed in #1855 · 1 comment
Assignees
Labels
Accepted Changes have been accepted and will go in one of the next releases. Type: Feature New Feature
Milestone

Comments

@gpbl
Copy link
Owner

gpbl commented Jul 31, 2023

Discussed in #1855

Originally posted by BhoomikaSorathiya July 27, 2023

Bug description

In react-day-picker v7, there was DayPicker-Day--outside class for outside non-date div. But, for react-day-picker v8, there is no class provided to differentiate between date vs outside date .

Basically, I want to provide border to only which has date text. I am trying to do it with :has() css selector, but it doesn't support Firefox browser. So looking for alternative like classname with --outside. Can anyone please help?

To reproduce

Go to here for v8 & here for v7 and inspect element to see class names.

Expected behavior

There should be som class like rdp-cell--outside for outside table cell to differentiate with date cell.

Screenshots

react-day-picker v7 DayPicker-Day--outside class:

Screenshot 2023-07-27 at 6 51 10 PM

react-day-picker v8 rdp-cell class for outside table cell without any difference from date table cell:

Screenshot 2023-07-27 at 6 50 44 PM
@gpbl gpbl added the Type: Feature New Feature label Jul 31, 2023
@gpbl gpbl added this to the v8.9.0 milestone Jul 31, 2023
@gpbl gpbl added the Accepted Changes have been accepted and will go in one of the next releases. label Aug 16, 2023
@gpbl gpbl self-assigned this Aug 16, 2023
@gpbl gpbl modified the milestones: v8.9.0, v9.0.0 Oct 14, 2023
@tarngerine
Copy link

was just looking for this! would really like this, the new nested .rdp-cell > .rdp-day DOM structure makes it difficult to do any sibling selectors where you want to select the previous sibling

use case, trying to get a faded highlighted range like in airbnb

image
  .rdp-cell:not(:has(.rdp-day_outside)) + .rdp-cell:has(.rdp-day_highlighted.rdp-day_outside) {
    ::before {
      background: transparent;
      background-image: linear-gradient(to right, ${color("bgBorder")}, transparent);
    }
  }
  .rdp-cell:has(.rdp-day_highlighted.rdp-day_outside):has(+ .rdp-cell:has(.rdp-day_outside)) {
    ::before {
      background: transparent;
      background-image: linear-gradient(to left, ${color("bgBorder")}, transparent);
    }
  }

the 2nd rule does not work, even in chrome, because you cannot nest :has selectors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Changes have been accepted and will go in one of the next releases. Type: Feature New Feature
Projects
Status: Backlog
Development

No branches or pull requests

2 participants