The user reported that the "emoji button after like which is share that not showing in dark mode". This refers to the share button (which uses the AiOutlineShareAlt icon) that appears after the like button in blog post cards.
The share button in the ShareDialogBox component was using Tailwind CSS classes for dark mode styling, but there might have been CSS specificity issues or the styling wasn't being applied correctly in all cases.
src/components/shareDialogBox/ShareDialogBox.jsx
Added comprehensive inline styles to ensure the share icon is always visible in dark mode:
<AiOutlineShareAlt
size={20}
className={`transition-colors duration-200 hover:text-blue-500 ${
mode === 'dark' ? 'text-white hover:text-blue-400' : 'text-gray-700 hover:text-blue-600'
}`}
style={{
color: mode === 'dark' ? '#ffffff' : '#374151',
filter: mode === 'dark' ? 'brightness(1)' : 'none',
opacity: mode === 'dark' ? '1' : '1',
display: 'block',
visibility: 'visible',
fill: mode === 'dark' ? '#ffffff' : '#374151'
}}
/>- Added comprehensive inline styles: Added multiple style properties to ensure visibility in dark mode:
color: Sets explicit colors for both light and dark modesfilter: Ensures brightness in dark modeopacity: Maintains full opacitydisplay: Ensures the icon is displayed as a block elementvisibility: Explicitly sets visibility to visiblefill: Sets the fill color for SVG icons
- Maintained existing classes: Kept the existing Tailwind CSS classes for hover effects and transitions
- Enhanced fallback styling: Multiple inline styles ensure the icon is always visible in dark mode, regardless of CSS specificity issues
- Improved visibility: The share button is now clearly visible in dark mode
- Consistent styling: The icon maintains its hover effects and transitions
- Reliable rendering: Inline styles have higher specificity than CSS classes
- Better UX: Users can now easily identify and use the share functionality in dark mode
The fix ensures that:
- The share button is visible in dark mode
- The share button maintains its hover effects
- The share button is positioned correctly after the like button
- The share functionality works as expected
ShareDialogBoxcomponent is used in:src/pages/home/Home.jsx(featured posts)src/pages/allBlogs/AllBlogs.jsx(all blog posts)src/pages/blogInfo/BlogInfo.jsx(individual blog posts)
This fix complements the previous fixes for:
- Featured post text visibility in dark mode
- Blog post title visibility in dark mode
- Share button (
FaShare) visibility in dark mode
All share-related buttons and icons are now properly visible in both light and dark modes.