diff --git a/src/style.css b/src/style.css index a7bb78c46..ef57fa9c8 100644 --- a/src/style.css +++ b/src/style.css @@ -32,6 +32,8 @@ --rdp-range_middle-background-color: var(--rdp-accent-background-color); /* The color of the background for days in the middle of a range. */ --rdp-range_middle-font: normal medium var(--rdp-font-family); /* The font for days in the middle of a range. */ + --rdp-range_middle-foreground-color: white; /* The font for days in the middle of a range. */ + --rdp-range_middle-color: inherit;/* The color of the range text. */ --rdp-range_start-color: white; /* The color of the range text. */ --rdp-range_start-background: linear-gradient(var(--rdp-gradient-direction), transparent 50%, var(--rdp-range_middle-background-color) 50%); /* Used for the background of the start of the selected range. */ @@ -315,6 +317,7 @@ border-color: transparent; border: unset; border-radius: unset; + color: var(--rdp-range_middle-color); } .rdp-range_end { diff --git a/src/style.module.css b/src/style.module.css index 4f078a19c..2cfbc2dab 100644 --- a/src/style.module.css +++ b/src/style.module.css @@ -32,6 +32,8 @@ --rdp-range_middle-background-color: var(--rdp-accent-background-color); /* The color of the background for days in the middle of a range. */ --rdp-range_middle-font: normal medium var(--rdp-font-family); /* The font for days in the middle of a range. */ + --rdp-range_middle-foreground-color: white; /* The font for days in the middle of a range. */ + --rdp-range_middle-color: inherit;/* The color of the range text. */ --rdp-range_start-color: white; /* The color of the range text. */ --rdp-range_start-background: linear-gradient(var(--rdp-gradient-direction), transparent 50%, var(--rdp-range_middle-background-color) 50%); /* Used for the background of the start of the selected range. */ @@ -315,6 +317,7 @@ border-color: transparent; border: unset; border-radius: unset; + color: var(--rdp-range_middle-color); } .range_end { @@ -332,5 +335,6 @@ } .day_button:focus-visible { + /* outline: 2px solid var(--rdp-accent-color); */ /* You may want to add focus-outlines here. */ } diff --git a/website/docs/docs/styling.mdx b/website/docs/docs/styling.mdx index 23e553fbf..8aa681a4e 100644 --- a/website/docs/docs/styling.mdx +++ b/website/docs/docs/styling.mdx @@ -79,6 +79,7 @@ The following table lists the CSS variables used by DayPicker inside the `.rdp-r | `--rdp-nav-height` | The height of the navigation bar. | | `--rdp-range_middle-background-color` | The color of the background for days in the middle of a range. | | `--rdp-range_middle-font` | The font for days in the middle of a range. | +| `-- ` | The color of the text for days in the middle of a range. | | `--rdp-range_start-color` | The color of the range text at the start of the range. | | `--rdp-range_start-background` | Used for the background of the start of the selected range. | | `--rdp-range_start-date-background-color` | The background color of the date at the start of the selected range. | diff --git a/website/src/pages/playground.tsx b/website/src/pages/playground.tsx index cbd0c1571..ee8fd5c86 100644 --- a/website/src/pages/playground.tsx +++ b/website/src/pages/playground.tsx @@ -55,8 +55,9 @@ export default function Playground() { const [utc, setUtc] = React.useState(false); const [accentColor, setAccentColor] = React.useState(); - const [backgroundAccentColor, setAccentBackgroundColor] = + const [backgroundAccentColor, setBackgroundAccountColor] = React.useState(); + const [rangeMiddleColor, setrangeMiddleColor] = React.useState(); const Component = utc ? DayPickerUtc : DayPicker; const formattedProps = ``; @@ -69,6 +70,7 @@ export default function Playground() { [data-theme="dark"] .rdp-root { ${accentColor ? `--rdp-accent-color: ${accentColor} !important` : ""}; ${backgroundAccentColor ? `--rdp-accent-background-color: ${backgroundAccentColor} !important` : ""}; + ${rangeMiddleColor ? `--rdp-range_middle-color: ${rangeMiddleColor} !important` : ""}; } `} @@ -406,15 +408,26 @@ export default function Playground() { ) : null} {props.mode === "range" && ( - + <> + + + )}