-
-
Notifications
You must be signed in to change notification settings - Fork 739
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add Tailwind CSS example (#2175)
* Update styling docs * Export getDefaultClassNames helper
- Loading branch information
Showing
6 changed files
with
109 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from "react"; | ||
|
||
import { DayPicker, getDefaultClassNames } from "react-day-picker"; | ||
|
||
export function TailwindCSS() { | ||
const defaultClassNames = getDefaultClassNames(); | ||
return ( | ||
<> | ||
<style> | ||
{` | ||
.bg-amber-500 { background-color: #f59e0b; } | ||
.border-amber-500 { border-color: #f59e0b; } | ||
.text-white { color: #fff; } | ||
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); } | ||
.p-5 { padding: 1.25rem; } | ||
.fill-amber-500 { fill: #f59e0b; } | ||
`} | ||
</style> | ||
<DayPicker | ||
mode="single" | ||
classNames={{ | ||
today: `border-amber-500`, | ||
selected: `bg-amber-500 border-amber-500 text-white`, | ||
calendar: `${defaultClassNames.calendar} bg-white shadow-lg p-5`, | ||
chevron: `${defaultClassNames.chevron} fill-amber-500` | ||
}} | ||
/> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Only export helpers that can be useful to other developers. | ||
export * from "./getDefaultClassNames"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters