forked from mdbootstrap/TW-Elements
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the alert component base style for html package
- Loading branch information
Showing
5 changed files
with
73 additions
and
3 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
const typography = { | ||
sans: ["Roboto", "sans-serif"], | ||
serif: ["Roboto Slab", "serif"], | ||
body: ["Roboto", "sans-serif"], | ||
body: ["Roboto", "sans-serif"] | ||
}; | ||
|
||
module.exports = typography; |
37 changes: 37 additions & 0 deletions
37
packages/material-tailwind-html/theme/components/alert/index.js
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,37 @@ | ||
const alertRoot = { | ||
position: "relative", | ||
padding: "1rem", | ||
"margin-bottom": "1rem", | ||
border: "0 solid transparent", | ||
"border-radius": "0.375rem", | ||
"line-height": "1.25rem", | ||
opacity: "1", | ||
transition: "opacity .15s linear", | ||
|
||
"&.hide": { | ||
opacity: "0", | ||
display: "none" | ||
} | ||
}; | ||
|
||
const alertVariant = (theme, background) => ({ | ||
"background-color": theme(`${background}.500`), | ||
color: "#fff", | ||
|
||
"&.alert-gradient": { | ||
"background-image": `linear-gradient(to top right, ${theme( | ||
`${background}.600` | ||
)}, ${theme(`${background}.400`)})` | ||
} | ||
}); | ||
|
||
const alert = (theme) => ({ | ||
".alert": alertRoot, | ||
".alert-pink": alertVariant(theme, "colors.pink"), | ||
".alert-blue": alertVariant(theme, "colors.blue"), | ||
".alert-red": alertVariant(theme, "colors.red"), | ||
".alert-brown": alertVariant(theme, "colors.brown") | ||
}); | ||
|
||
module.exports.alertVariant = alertVariant; | ||
module.exports.alert = alert; |
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