-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(styleguide): add classes to color social shared buttons
- Loading branch information
1 parent
0cd5ec4
commit 94059ee
Showing
4 changed files
with
55 additions
and
7 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
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,28 @@ | ||
const plugin = require('tailwindcss/plugin'); | ||
const colorFunctions = require('daisyui/src/theming/functions'); | ||
|
||
const colorProperties = (colorName, theme) => { | ||
const color = theme("colors." + colorName); | ||
const colorFocus = colorFunctions.generateDarkenColorFrom(color); | ||
// const colorContent = colorFunctions.generateForegroundColorFrom(color); | ||
|
||
return { | ||
'color': 'white', | ||
'background-color': color, | ||
'&:hover': { | ||
'background-color': theme("colors." + colorName + "-focus", "hsl(" + colorFocus + ")") | ||
} | ||
} | ||
} | ||
|
||
const socialbutton = plugin(({ addUtilities, theme }) => { | ||
|
||
addUtilities({ | ||
'.btn-whatsapp': colorProperties('whatsapp', theme), | ||
'.btn-facebook': colorProperties('facebook', theme), | ||
'.btn-twitter': colorProperties('twitter', theme), | ||
'.btn-copy': colorProperties('copy', theme), | ||
}) | ||
}) | ||
|
||
module.exports = socialbutton |
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