Skip to content

feat/light-mode #444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

feat/light-mode #444

wants to merge 7 commits into from

Conversation

marcin-hoa
Copy link
Contributor

@marcin-hoa marcin-hoa commented May 13, 2025

Readded light-mode branch in order to have the possibility to test it out.

Summary by CodeRabbit

  • New Features

    • Added theme toggling support with light and dark modes across the site, including new icons and a toggle button in the header.
    • Integrated a new dependency enabling theme variants based on user color scheme preferences.
  • Enhancements

    • Improved visual consistency with updated text colors, backgrounds, borders, gradients, and typography in multiple components.
    • Enhanced article card image loading with prioritized loading and refined layering.
    • Updated navigation and footer for better alignment, color handling, and responsiveness.
    • Refined button styles for better centering, text color, and font weight.
    • Applied consistent white text color to icons, buttons, and labels.
    • Converted several components to standalone for improved modularity.
    • Replaced anchor tags with a custom button directive for consistent styling.
    • Adjusted article and author card styling for improved text color and background transparency.
    • Improved heading and card background styling for clearer visual hierarchy.
    • Added text color styling to author names and article list titles for better readability.
    • Updated footer social media and navigation link colors for enhanced contrast.
    • Enhanced dark mode support with updated CSS selectors and theme attribute usage.
    • Added support for image loading priority in article cards.
    • Centered navigation list items horizontally and added conditional text color styling based on theme.
    • Updated pill component "flat" variant to include white text color.
    • Added trailing commas and reordered attributes in some components for consistency.
    • Improved code block inline text color in articles for better readability.
  • Bug Fixes

    • Removed duplicate component imports to prevent potential rendering issues.
  • Chores

    • Streamlined CSS variables and Tailwind configuration to support new theming capabilities.
    • Simplified component templates and styling directives for maintainability.
    • Cleaned up footer layout and removed dynamic year display for simplicity.
    • Improved CSS class bindings to support dark mode variants and consistent styling.
    • Updated theme management to use data attributes on the root element for better theme control.
    • Removed unused imports and properties from components for cleaner code.

@marcin-hoa marcin-hoa requested a review from DDonochVA May 13, 2025 06:10
Copy link

coderabbitai bot commented May 13, 2025

Walkthrough

This update introduces light mode support across the application by enhancing color theming with new CSS variables, Tailwind configuration, and the tailwindcss-theme-variants plugin. Numerous components and templates are adjusted to use new or updated color classes, conditional styling for light/dark modes, and improved background or border handling. Several Angular components are refactored for standalone usage and styling consistency. Minor template and style refinements improve text color, background transparency, and image loading priority.

Changes

Files/Groups Change Summary
tailwind.preset.js, libs/shared/assets/src/lib/styles/main.scss, package.json Added light mode support via theme variants, new color tokens (al-primary-foreground, al-grey), and plugin configuration; updated CSS variables and Tailwind settings; added tailwindcss-theme-variants dependency.
libs/blog/shared/ui-card/src/lib/card.component.ts, card.stories.ts Updated card and gradient card classes for background, border, and transparency; added bg-al-card class.
libs/blog/articles/ui-article-card/src/lib/components/article-compact-card/article-compact-card.component.ts, .html Refactored to standalone component, added imagePriority input, switched background image from CSS to <img>, updated layering and styling.
libs/blog/articles/ui-article-card/src/lib/components/article-regular-card/article-regular-card.component.html Enhanced styling for border, text, and image priority; added explicit color and font classes.
libs/blog/articles/ui-article-card/src/lib/components/article-horizontal-card/article-horizontal-card.component.html Changed article border and removed max-height for light mode compatibility.
libs/blog/articles/ui-article-card/src/lib/components/article-hero-card/article-hero-card-skeleton.component.ts Added bg-transparent to card for background styling.
libs/blog/articles/ui-article-card/src/lib/ui-article-card/ui-article-card.component.html Passed imagePriority input to compact card variant.
libs/blog/articles/feature-latest-articles/src/lib/feature-latest-articles/feature-latest-articles.component.ts Removed duplicate CardComponent import.
libs/blog/about-us/feature-about-us/src/lib/feature-about-us/feature-about-us.component.html Added text-al-primary-foreground to headings, bg-transparent to card.
libs/blog/articles/ui-article-list-title/src/lib/ui-article-list-title/ui-article-list-title.component.html Added text-al-primary-foreground to title.
libs/blog/authors/ui-author-card/src/lib/author-card/author-card-template.component.ts Made component standalone, removed gradient card directive, moved gradient styling to inner div with dark/light mode classes.
libs/blog/authors/ui-author-card/src/lib/author-card/author-card.component.html Added text-al-foreground to author name.
libs/blog/become-author/feature-become-author-page/src/lib/feature-become-author-page.component.html Replaced styled anchor buttons with al-button directive, simplified classes, adjusted button text structure.
libs/blog/become-author/feature-become-author-page/src/lib/become-author-page/become-author-page.component.ts Imported and added ButtonComponent to imports array.
libs/blog/become-author/feature-become-author-page/src/lib/components/become-author-list-item/become-author-list-item.component.html Added text-white to index text, reordered SVG attributes, minor formatting fixes.
libs/blog/layouts/ui-layouts/src/lib/footer/footer.component.html, .scss, components/footer-logo.component.ts, components/footer-social-media-icons.component.ts Changed footer background to hex color, removed copyright year input and display, updated logo and social icon text colors, adjusted grid layout and breakpoints.
libs/blog/layouts/ui-navigation/src/lib/navigation/navigation.component.html, .ts Centered navigation links, added whiteFont input property, applied conditional text color classes for links.
libs/blog/newsletter/feature-newsletter/src/lib/feature-newsletter/newsletter.component.html Added text-al-primary-foreground to newsletter title.
libs/blog/partners/ui-partners/src/lib/partners-list/partners-list.component.html Added light:border and light:rounded-lg classes to partner links.
libs/blog/shared/ui-difficulty/src/lib/ui-difficulty.component.ts Updated class bindings to include dark mode variants and adjusted background/shadow colors based on isColorBackground().
libs/blog/shared/ui-pill/src/lib/pill.directive.ts Added text-white class to "flat" pill variant styling.
libs/blog/shared/ui-social-media-icons/src/lib/social-media-icons.component.html Added text-[#fff] class to social media icon items.
libs/blog/writing-rules/feature-writing-rules/src/lib/rules-row/rules-row.component.html Added text-white class to step index and next button text.
libs/blog/layouts/ui-navigation/src/lib/language-picker/language-picker.component.ts Replaced text-gray-400 with text-al-primary-foreground on label element.
libs/blog/shared/ui-button/src/lib/button/button.component.ts Added justify-center to base button classes; extended Primary variant with text-white font-bold uppercase.
libs/blog/articles/ui-article-content/src/lib/article-content/article-content.component.scss Added color: white to inline code elements for better contrast on dark backgrounds.
libs/blog/layouts/ui-layouts/src/lib/header/components/header-hamburger.component.ts Changed hamburger lines color from bg-white to bg-al-primary-foreground.
libs/blog/app-theme/data-access-app-theme/src/app-theme.store.ts Exported Theme type; added theme toggle method; replaced CSS class theme switching with data-theme attribute manipulation; patched store state on theme changes.
libs/blog/layouts/ui-layouts/src/lib/header/header.component.ts Added theme input and toggle output; added computed icon for theme switch; updated template with toggle button and icon.
libs/blog/shared/ui-icon/src/lib/icon/icon.component.ts Extended IconType union with 'sun' and 'moon'.
libs/blog/shell/feature-shell-web/src/lib/root-shell.component.ts Injected AppThemeStore, exposed theme signal, passed theme and toggle event to header, added toggle handler method.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant App
    participant ThemePlugin
    participant Component

    User->>App: Loads application
    App->>ThemePlugin: Detects color scheme (light/dark)
    ThemePlugin-->>App: Applies appropriate theme classes/variables
    App->>Component: Renders with theme-aware classes (e.g., text-al-primary-foreground)
    Component-->>User: Displays UI with correct light/dark styling
Loading

Possibly related PRs

Suggested reviewers

  • DamianBrzezinskiHoA
  • mateuszbasinski
  • dokolyski

Poem

🐇
Light and dark now dance in tune,
With colors bright as sun or moon.
Cards and borders, pink and white,
Adapt to day or gentle night.
A hop, a skip—new themes delight!

—Your friendly rabbit, styling right!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e4aeaa0 and 9c822c6.

📒 Files selected for processing (2)
  • libs/blog/articles/feature-comments/src/lib/giscus-comments/giscus-comments.component.html (1 hunks)
  • libs/blog/articles/feature-comments/src/lib/giscus-comments/giscus-comments.component.ts (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
libs/blog/articles/feature-comments/src/lib/giscus-comments/giscus-comments.component.ts (1)
libs/blog/app-theme/data-access-app-theme/src/app-theme.store.ts (1)
  • AppThemeStore (11-38)
🔇 Additional comments (3)
libs/blog/articles/feature-comments/src/lib/giscus-comments/giscus-comments.component.html (1)

14-14: LGTM! Correct implementation of reactive theme binding.

The change from config.theme to theme() properly integrates the Giscus widget with the dynamic theme system, allowing it to automatically update when users switch between light and dark modes.

libs/blog/articles/feature-comments/src/lib/giscus-comments/giscus-comments.component.ts (2)

17-17: LGTM! Correct import for theme management.

The import of AppThemeStore is properly structured and follows the established import patterns in the codebase.


33-33: LGTM! Proper theme integration implementation.

The theme property injection correctly accesses the AppThemeStore's theme signal, enabling reactive theme switching for the Giscus comments widget. The readonly modifier is appropriate since theme changes should be handled through the store's methods.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@valueadd-robot
Copy link

PR is detected, will deploy to dev environment

@valueadd-robot
Copy link

Deployed to dev environment
Branch: feature/light-mode
BFF URL: https://dbdc7bbc-blog-bff-dev.contact-ef8.workers.dev
Deploy URL: https://a7b8ff11.angular-love-client.pages.dev
Alias URL: https://feature-light-mode.angular-love-client.pages.dev

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🧹 Nitpick comments (2)
libs/blog/become-author/feature-become-author-page/src/lib/become-author-page/become-author-page.component.html (2)

34-34: Consider using theme-aware text color for improved theme compatibility

While white text works well on the pink background, if the button background color might change based on theme, consider using a theme-aware text color class.

If the button background remains pink in all themes, this change is fine. Otherwise, consider:

- <p class="text-sm font-bold text-white">
+ <p class="text-sm font-bold text-al-pink-foreground">

This assumes you have defined appropriate foreground colors for your themed backgrounds.


64-64: Consider using theme-aware text color for improved theme compatibility

Similar to the other button, if the background color remains pink in all themes, white text is appropriate. For full theme support, consider a variable-based approach.

If the button background remains pink in all themes, this change is fine. Otherwise, consider using a theme-aware text color that complements the button background.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3be6ade and 1e19dd3.

⛔ Files ignored due to path filters (2)
  • apps/blog/src/assets/icons/arrow-down.svg is excluded by !**/*.svg
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (30)
  • libs/blog/about-us/feature-about-us/src/lib/feature-about-us/feature-about-us.component.html (2 hunks)
  • libs/blog/articles/feature-latest-articles/src/lib/feature-latest-articles/feature-latest-articles.component.ts (0 hunks)
  • libs/blog/articles/ui-article-card/src/lib/components/article-compact-card/article-compact-card.component.html (1 hunks)
  • libs/blog/articles/ui-article-card/src/lib/components/article-compact-card/article-compact-card.component.ts (2 hunks)
  • libs/blog/articles/ui-article-card/src/lib/components/article-hero-card/article-hero-card-skeleton.component.ts (1 hunks)
  • libs/blog/articles/ui-article-card/src/lib/components/article-horizontal-card/article-horizontal-card.component.html (1 hunks)
  • libs/blog/articles/ui-article-card/src/lib/components/article-regular-card/article-regular-card.component.html (3 hunks)
  • libs/blog/articles/ui-article-card/src/lib/ui-article-card/ui-article-card.component.html (1 hunks)
  • libs/blog/articles/ui-article-list-title/src/lib/ui-article-list-title/ui-article-list-title.component.html (1 hunks)
  • libs/blog/authors/ui-author-card/src/lib/author-card/author-card-template.component.ts (2 hunks)
  • libs/blog/authors/ui-author-card/src/lib/author-card/author-card.component.html (1 hunks)
  • libs/blog/become-author/feature-become-author-page/src/lib/become-author-page/become-author-page.component.html (2 hunks)
  • libs/blog/become-author/feature-become-author-page/src/lib/components/become-author-list-item/become-author-list-item.component.html (1 hunks)
  • libs/blog/layouts/ui-layouts/src/lib/footer/components/footer-logo.component.ts (2 hunks)
  • libs/blog/layouts/ui-layouts/src/lib/footer/components/footer-social-media-icons.component.ts (1 hunks)
  • libs/blog/layouts/ui-layouts/src/lib/footer/footer.component.html (1 hunks)
  • libs/blog/layouts/ui-layouts/src/lib/footer/footer.component.scss (1 hunks)
  • libs/blog/layouts/ui-navigation/src/lib/navigation/navigation.component.html (3 hunks)
  • libs/blog/layouts/ui-navigation/src/lib/navigation/navigation.component.ts (1 hunks)
  • libs/blog/newsletter/feature-newsletter/src/lib/feature-newsletter/newsletter.component.html (1 hunks)
  • libs/blog/partners/ui-partners/src/lib/partners-list/partners-list.component.html (1 hunks)
  • libs/blog/shared/ui-card/src/lib/card.component.ts (2 hunks)
  • libs/blog/shared/ui-card/src/lib/card.stories.ts (1 hunks)
  • libs/blog/shared/ui-difficulty/src/lib/ui-difficulty.component.ts (3 hunks)
  • libs/blog/shared/ui-pill/src/lib/pill.directive.ts (1 hunks)
  • libs/blog/shared/ui-social-media-icons/src/lib/social-media-icons.component.html (1 hunks)
  • libs/blog/writing-rules/feature-writing-rules/src/lib/rules-row/rules-row.component.html (2 hunks)
  • libs/shared/assets/src/lib/styles/main.scss (1 hunks)
  • package.json (1 hunks)
  • tailwind.preset.js (2 hunks)
💤 Files with no reviewable changes (1)
  • libs/blog/articles/feature-latest-articles/src/lib/feature-latest-articles/feature-latest-articles.component.ts
🧰 Additional context used
🧬 Code Graph Analysis (1)
libs/blog/articles/ui-article-card/src/lib/components/article-compact-card/article-compact-card.component.ts (1)
libs/blog/shared/types/src/lib/article-card.ts (1)
  • ArticleCard (1-13)
🔇 Additional comments (48)
package.json (1)

67-67: Verify plugin version compatibility
The plugin is added as a beta release; please confirm that 2.0.0-beta.0 of tailwindcss-theme-variants is compatible with Tailwind CSS ^3.3.6 and appropriate for production use.

libs/blog/shared/ui-card/src/lib/card.stories.ts (1)

61-61: Demonstration of transparent background variant
This story correctly showcases the transparent background use case by applying bg-transparent to the <al-card> element.

libs/blog/newsletter/feature-newsletter/src/lib/feature-newsletter/newsletter.component.html (1)

8-8: Consistent use of primary-foreground token
Applying text-al-primary-foreground ensures that the heading color adapts to theme variants and remains consistent across light/dark modes.

libs/blog/articles/ui-article-card/src/lib/components/article-hero-card/article-hero-card-skeleton.component.ts (1)

10-10: Consistent transparent background
Adding bg-transparent aligns the skeleton card with the new light-mode theming, ensuring the skeleton blends correctly across themes.

libs/blog/articles/ui-article-card/src/lib/components/article-horizontal-card/article-horizontal-card.component.html (1)

3-3: Verify removal of fixed height
Removing max-h-52 in favor of theme-based styling could affect the card's vertical sizing. Please verify that the card height remains consistent and does not overflow its container across breakpoints.

libs/blog/authors/ui-author-card/src/lib/author-card/author-card.component.html (1)

45-45: Apply theme-aware text color
Adding text-al-foreground ensures the author name responds to light/dark mode variants and aligns with the new theming tokens. Looks good.

libs/blog/partners/ui-partners/src/lib/partners-list/partners-list.component.html (1)

6-6: Verify dark mode background color
With bg-white still applied, this element may not adapt its background in dark mode. Please confirm that bg-white is intended, or consider using a theme-variant class (e.g., dark:bg-al-card) so the background aligns with dark theme.

libs/blog/articles/ui-article-list-title/src/lib/ui-article-list-title/ui-article-list-title.component.html (1)

4-4: Standardize primary heading color
Adding text-al-primary-foreground ensures the title adheres to the new primary text color token and is consistent with other headings across the app.

libs/blog/articles/ui-article-card/src/lib/ui-article-card/ui-article-card.component.html (1)

15-18: LGTM! Improved consistency across card variants

Adding the imagePriority input to the compact card variant brings consistency with the other card types and enables image loading optimization.

libs/blog/writing-rules/feature-writing-rules/src/lib/rules-row/rules-row.component.html (2)

14-14: Good addition of explicit text color

Adding the text-white class ensures the step numbers maintain proper contrast with the pink background in both light and dark modes.


49-49: Proper contrast for button text

The addition of text-white ensures the button text has adequate contrast against the pink background regardless of theme, supporting accessibility.

libs/blog/about-us/feature-about-us/src/lib/feature-about-us/feature-about-us.component.html (3)

2-2: Good use of semantic color token

Using text-al-primary-foreground for the title enables proper theme adaptation instead of a hard-coded color value.


6-6: Appropriate background setting for theme support

Setting the card to bg-transparent allows it to properly inherit background colors when switching between light and dark themes.


38-38: Consistent use of semantic color token

Using text-al-primary-foreground for the authors title maintains styling consistency with the main title and supports theme adaptation.

libs/blog/layouts/ui-navigation/src/lib/navigation/navigation.component.html (3)

9-9: Improved layout with centered navigation

Adding justify-center improves the horizontal navigation layout by properly centering the navigation items.


24-25: Good implementation of theme-aware text styling

Replacing static text color with conditional styling [ngClass]="whiteFont() ? 'text-white' : 'text-al-foreground'" enables proper text color adaptation based on context and theme.

Make sure the whiteFont() input property is properly implemented in the component TypeScript file and documented for consumers of this component.


37-38: Consistent styling for external links

The same conditional text styling is correctly applied to external links, maintaining styling consistency across all navigation items.

libs/blog/layouts/ui-layouts/src/lib/footer/components/footer-logo.component.ts (1)

2-2: Good component simplification

Removing the unused input import and the currentYear property simplifies the component appropriately. This cleanup removes unnecessary functionality while maintaining the component's core purpose.

Ensure that any components using <al-footer-logo> no longer pass the currentYear input property, as it has been removed.

Also applies to: 23-23

libs/blog/become-author/feature-become-author-page/src/lib/components/become-author-list-item/become-author-list-item.component.html (3)

3-5: Consistent trailing comma in [ngClass] object literal
The trailing comma after the single entry is valid and aligns with our formatting conventions for multiline object literals.


11-11: Explicit text-white class applied for contrast
Adding text-white ensures the index label remains legible against the pink background.


15-15: Use of text-al-pink token for the tick icon
The text-al-pink token aligns with our design system’s color palette.

libs/blog/layouts/ui-layouts/src/lib/footer/footer.component.html (1)

5-6: Footer logo and navigation setup looks good
Explicitly centering the logo and passing whiteFont="true" to <al-navigation> ensures consistent styling.

libs/blog/layouts/ui-layouts/src/lib/footer/footer.component.scss (2)

15-17: Updated default grid-template-areas
The new two-row layout ('logo social' / 'nav nav') is clear and concise for smaller viewports.


19-23: Verify breakpoint rename from @screen xl to @screen lg
Dropping the MD breakpoint and shifting the XL layout to LG may alter mid-size layouts. Please confirm that the updated breakpoints align with the design mockups and QA in all viewport widths.

libs/shared/assets/src/lib/styles/main.scss (2)

11-17: New CSS variables for theming added
Introducing --primary-foreground and --grey completes the palette for both light and dark modes. This aligns with the Tailwind configuration’s new tokens.


19-29: Light-mode media query block implemented
The prefers-color-scheme: light override correctly defines lighter values for all variables, enabling automatic theme switching.

libs/blog/shared/ui-card/src/lib/card.component.ts (2)

71-73: GradientCardDirective classes updated for theme variants
Switching to 'bg-al-radial-gradient dark:bg-al-background' removes the border and adds a dark-mode fallback—this matches our updated theming strategy.


99-101: Ensure component and directive hostClasses merge correctly
Both CardComponent and a consumer of alGradientCard bind to the class attribute. Please verify in the rendered DOM that classes from both the component and the directive are applied and not overridden.

libs/blog/authors/ui-author-card/src/lib/author-card/author-card-template.component.ts (3)

11-11: Great conversion to standalone component!

This conversion to a standalone component aligns with modern Angular best practices and improves the component's modularity.


23-24: Properly implemented light/dark mode styling

The alGradientCard directive and conditional dark/light mode classes are correctly applied, ensuring consistent styling that adapts to the theme. The background styling appropriately uses different colors for each theme variant.


27-28: LGTM: Content styling with directive

Adding the alCardContent directive to the inner content maintains styling consistency with other card components in the application.

libs/blog/articles/ui-article-card/src/lib/components/article-compact-card/article-compact-card.component.html (3)

3-3: Improved positioning and container styling

The addition of relative, overflow-hidden, and bg-black classes properly prepares the container for the new image layering approach.


6-13: Great improvement using proper image elements

Replacing CSS background with an actual <img> element is a significant improvement that:

  • Enhances accessibility with proper alt text
  • Enables image optimization through NgOptimizedImage
  • Provides better loading control with the priority attribute
  • Makes explicit width/height handling possible

The absolute positioning with opacity control creates a nice background effect while maintaining content readability.


14-14: Proper text color handling

The explicit text color setting ensures good contrast over the background image in all scenarios.

libs/blog/articles/ui-article-card/src/lib/components/article-compact-card/article-compact-card.component.ts (2)

1-1: Well-implemented standalone component conversion

The component has been properly converted to standalone with all necessary imports. Including NgOptimizedImage enables better image loading performance and optimization.

Also applies to: 13-20


25-25: Good addition of image priority control

The new imagePriority input property allows control over image loading priority, which is important for performance optimization and core web vitals. This aligns with the template changes using this property.

libs/blog/articles/ui-article-card/src/lib/components/article-regular-card/article-regular-card.component.html (5)

3-3: Improved border styling for theme consistency

The border styling now properly handles light and dark mode variations, maintaining visual separation in light mode while using transparent borders in dark mode.


21-25: Enhanced avatar component with priority loading

Adding the [priority] binding to the avatar component improves loading performance for this important UI element.


26-28: Proper text color styling for author name

The explicit text color class ensures consistent styling across light and dark modes.


41-47: Improved heading styling with proper color and text properties

The heading now uses explicit color, font weight, and style classes, ensuring consistent appearance across theme modes.


48-50: Consistent paragraph styling with theme-aware colors

The paragraph styling now properly uses theme-specific colors with appropriate font styling.

tailwind.preset.js (4)

1-5: Excellent addition of theme variant support

Good job introducing the tailwindcss-theme-variants plugin which enables media query-based theme switching. This is a more modern approach than the class-based dark mode.


13-14: New color tokens look good

The addition of 'al-primary-foreground' and 'al-grey' tokens will help maintain consistent theming across light and dark modes.

Also applies to: 22-22


35-35: Box shadow color change looks intentional

Changing from --border to --grey for the al-full-border shadow matches the new theming approach. Just ensure this change doesn't unexpectedly affect existing components.


39-51: Well-structured theme configuration

The plugin configuration properly sets up light and dark themes using media queries. This approach allows the UI to automatically adapt to the user's system preferences.

libs/blog/shared/ui-difficulty/src/lib/ui-difficulty.component.ts (3)

28-30: Good adaptation for light/dark mode in left block

The conditional class application correctly handles both light and dark modes based on the isColorBackground() condition:

  • Using dark:bg-al-background bg-transparent for colored backgrounds
  • Using bg-al-grey for non-colored backgrounds

This approach maintains visual consistency across themes.


47-50: Well-implemented shadow handling for different themes

The shadow classes are properly updated for the dot container:

  • dark:shadow-al-full-background shadow-transparent for colored backgrounds
  • shadow-al-full-border for non-colored backgrounds

This ensures proper visual representation in both light and dark modes.


80-82: Consistent styling in right block

The right block styling matches the left block's implementation, maintaining design consistency throughout the component. The code cleanly handles both light and dark themes.

@@ -9,7 +9,7 @@ import { SocialMediaIconsComponent } from '@angular-love/blog/shared/ui-social-m
<div class="flex flex-col items-start">
<h3
id="social-media-title"
class="mb-4 hidden text-sm font-bold lg:block"
class="mb-4 hidden text-sm font-bold text-[#fff] lg:block"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Use design token instead of hardcoded hex
To support dynamic theming and maintain consistency with other components, replace the literal hex color with the text-al-primary-foreground token:

- class="mb-4 hidden text-sm font-bold text-[#fff] lg:block"
+ class="mb-4 hidden text-sm font-bold text-al-primary-foreground lg:block"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
class="mb-4 hidden text-sm font-bold text-[#fff] lg:block"
class="mb-4 hidden text-sm font-bold text-al-primary-foreground lg:block"

@@ -9,7 +9,7 @@ const pillVariants = cva(
{
variants: {
variant: <Record<AlPillVariant, string>>{
flat: 'bg-al-primary/90',
flat: 'bg-al-primary/90 text-white',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Use design token for pill text color
For theme variant compatibility, replace text-white with the text-al-primary-foreground token in the flat variant:

- flat: 'bg-al-primary/90 text-white',
+ flat: 'bg-al-primary/90 text-al-primary-foreground',
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
flat: 'bg-al-primary/90 text-white',
flat: 'bg-al-primary/90 text-al-primary-foreground',

Comment on lines +4 to +7
<al-social-media-icon-item
class="text-[#fff]"
[socialMediaConfig]="social"
/>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Replace hardcoded color with theme-aware class for light mode compatibility

Using a hardcoded white color (text-[#fff]) will make the icons difficult to see in light mode. Since this PR is adding light mode support, consider using a theme-aware class that changes based on the current theme.

Replace the hardcoded white color with a theme-aware class:

<al-social-media-icon-item
-  class="text-[#fff]"
+  class="text-al-primary-foreground"
  [socialMediaConfig]="social"
/>

This way, the icons will automatically adapt to the current theme (white in dark mode, dark in light mode).

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<al-social-media-icon-item
class="text-[#fff]"
[socialMediaConfig]="social"
/>
<al-social-media-icon-item
class="text-al-primary-foreground"
[socialMediaConfig]="social"
/>

@@ -32,6 +32,7 @@ export type NavItem = {
})
export class NavigationComponent {
readonly layout = input<'vertical' | 'horizontal'>('horizontal');
readonly whiteFont = input<boolean>(false);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider a more flexible theming approach instead of a boolean flag

While adding a whiteFont input provides basic text color control, a more comprehensive theming approach would better support light mode implementation.

Consider using a theme enum or string input that supports multiple theme options:

- readonly whiteFont = input<boolean>(false);
+ readonly textTheme = input<'default' | 'light' | 'dark' | 'contrast'>('default');

Then in the template, you could apply different classes based on the selected theme:

[ngClass]="{
  'text-white': textTheme() === 'light',
  'text-al-foreground': textTheme() === 'default',
  'text-al-primary': textTheme() === 'dark',
  'text-al-contrast': textTheme() === 'contrast'
}"

This approach would be more maintainable as you add more theme variants beyond just light mode.

Comment on lines +13 to +15
<small class="block pb-4 text-center text-xs text-[#6a798b]">
Copyright &#169; {{ currentYear }}
</small>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Hardcoded text color for copyright; use token
The inline text-[#6a798b] will not adjust for light mode. Swap in the design token (e.g., text-al-grey).

-  <small class="block pb-4 text-center text-xs text-[#6a798b]">
+  <small class="block pb-4 text-center text-xs text-al-grey">
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<small class="block pb-4 text-center text-xs text-[#6a798b]">
Copyright &#169; {{ currentYear }}
</small>
<small class="block pb-4 text-center text-xs text-al-grey">
Copyright &#169; {{ currentYear }}
</small>

@@ -1,17 +1,16 @@
<footer class="bg-al-card w-full">
<footer class="w-full bg-[#191a22]">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Hardcoded background color blocks theming
Using bg-[#191a22] ties the footer to one static color and prevents automatic switching in light mode. Replace this with a theme-aware token (e.g., bg-al-background).

-<footer class="w-full bg-[#191a22]">
+<footer class="w-full bg-al-background">
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<footer class="w-full bg-[#191a22]">
<footer class="w-full bg-al-background">

@valueadd-robot
Copy link

PR is detected, will deploy to dev environment

@valueadd-robot
Copy link

Deployed to dev environment
Branch: feature/light-mode
BFF URL: https://99e4388b-blog-bff-dev.contact-ef8.workers.dev
Deploy URL: https://babb5bbc.angular-love-client.pages.dev
Alias URL: https://feature-light-mode.angular-love-client.pages.dev

@valueadd-robot
Copy link

PR is detected, will deploy to dev environment

@valueadd-robot
Copy link

Deployed to dev environment
Branch: feature/light-mode
BFF URL: https://f56c1566-blog-bff-dev.contact-ef8.workers.dev
Deploy URL: https://12eb1423.angular-love-client.pages.dev
Alias URL: https://feature-light-mode.angular-love-client.pages.dev

@valueadd-robot
Copy link

PR is detected, will deploy to dev environment

@valueadd-robot
Copy link

Deployed to dev environment
Branch: feature/light-mode
BFF URL: https://eb347c0b-blog-bff-dev.contact-ef8.workers.dev
Deploy URL: https://3a9a6fd1.angular-love-client.pages.dev
Alias URL: https://feature-light-mode.angular-love-client.pages.dev

@valueadd-robot
Copy link

PR is detected, will deploy to dev environment

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
libs/blog/app-theme/data-access-app-theme/src/app-theme.store.ts (1)

42-42: Consider addressing the architectural TODO.

The TODO comment highlights a valid architectural concern about decoupling the store from CCAppThemeConsumer. Consider creating an interface to improve testability and modularity.

Would you like me to help design an interface to decouple the theme store from the consumer implementation?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4852439 and 31a555a.

⛔ Files ignored due to path filters (2)
  • apps/blog/src/assets/icons/moon.svg is excluded by !**/*.svg
  • apps/blog/src/assets/icons/sun.svg is excluded by !**/*.svg
📒 Files selected for processing (5)
  • libs/blog/app-theme/data-access-app-theme/src/app-theme.store.ts (3 hunks)
  • libs/blog/layouts/ui-layouts/src/lib/header/header.component.ts (3 hunks)
  • libs/blog/shared/ui-icon/src/lib/icon/icon.component.ts (1 hunks)
  • libs/blog/shell/feature-shell-web/src/lib/root-shell.component.ts (4 hunks)
  • libs/shared/assets/src/lib/styles/main.scss (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • libs/blog/shared/ui-icon/src/lib/icon/icon.component.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • libs/shared/assets/src/lib/styles/main.scss
🧰 Additional context used
🧬 Code Graph Analysis (1)
libs/blog/shell/feature-shell-web/src/lib/root-shell.component.ts (1)
libs/blog/app-theme/data-access-app-theme/src/app-theme.store.ts (1)
  • AppThemeStore (11-34)
🔇 Additional comments (11)
libs/blog/app-theme/data-access-app-theme/src/app-theme.store.ts (4)

3-3: Good addition of patchState import.

The import of patchState is necessary for properly updating the signal store state in the new methods.


5-5: Good export of Theme type for reusability.

Exporting the Theme type allows other components to import and use the same type definition, promoting type consistency across the application.


27-31: Excellent implementation of theme toggle functionality.

The toggleTheme method correctly:

  • Toggles between 'dark' and 'light' themes
  • Updates the DOM attribute via the consumer
  • Patches the store state with the new theme

The logic is clean and follows the signal store pattern properly.


45-47: Improvement: Using data attributes instead of CSS classes.

The change from setThemeClass to setThemeAttribute is a good architectural improvement. Using data-theme attributes instead of CSS classes provides better separation of concerns and is more semantic for theme management.

libs/blog/shell/feature-shell-web/src/lib/root-shell.component.ts (3)

79-81: Clean integration of theme store.

The injection of AppThemeStore and creation of a computed theme signal provides reactive theme state to the template. This follows Angular best practices for signal-based state management.


31-33: Proper template integration for theme management.

The template correctly:

  • Passes the reactive theme() signal to the header component
  • Handles the themeToggle event to trigger theme switching

This creates a clean data flow from store → shell → header.


104-106: Simple and effective theme toggle handler.

The onThemeToggle method correctly delegates to the store's toggleTheme method, maintaining separation of concerns between UI events and state management.

libs/blog/layouts/ui-layouts/src/lib/header/header.component.ts (4)

83-83: Well-typed theme input.

The theme input is properly typed as 'light' | 'dark' and marked as required, ensuring type safety and preventing undefined theme states.


87-87: Clean event-driven architecture.

The themeToggle output event follows Angular patterns for component communication, allowing the parent component to handle theme changes appropriately.


91-93: Intuitive icon selection logic.

The themeSwitchIcon computed property correctly shows:

  • Moon icon in light mode (to indicate switching to dark)
  • Sun icon in dark mode (to indicate switching to light)

This provides clear visual indication of the toggle action.


41-52: Excellent accessibility and styling for theme toggle.

The theme toggle button implementation includes:

  • Proper aria-label for screen readers
  • Clean styling with transparent background
  • Proper click event handling
  • Test ID for automated testing (once typo is fixed)
  • Semantic use of SVG icons

This provides a great user experience for theme switching.

aria-label="Toggle theme"
class="flex items-center bg-transparent p-1"
(click)="themeToggle.emit()"
date-testid="header-theme-switch"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix typo in data attribute.

There's a typo in the test ID attribute.

Apply this diff to fix the typo:

-            date-testid="header-theme-switch"
+            data-testid="header-theme-switch"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
date-testid="header-theme-switch"
data-testid="header-theme-switch"
🤖 Prompt for AI Agents
In libs/blog/layouts/ui-layouts/src/lib/header/header.component.ts at line 45,
there is a typo in the data attribute "date-testid". Change "date-testid" to the
correct attribute "data-testid" to fix the typo.

@valueadd-robot
Copy link

Deployed to dev environment
Branch: feature/light-mode
BFF URL: https://7d56e499-blog-bff-dev.contact-ef8.workers.dev
Deploy URL: https://226218aa.angular-love-client.pages.dev
Alias URL: https://feature-light-mode.angular-love-client.pages.dev

@valueadd-robot
Copy link

PR is detected, will deploy to dev environment

@valueadd-robot
Copy link

Deployed to dev environment
Branch: feature/light-mode
BFF URL: https://67638abc-blog-bff-dev.contact-ef8.workers.dev
Deploy URL: https://04c64b85.angular-love-client.pages.dev
Alias URL: https://feature-light-mode.angular-love-client.pages.dev

@valueadd-robot
Copy link

PR is detected, will deploy to dev environment

@valueadd-robot
Copy link

Deployed to dev environment
Branch: feature/light-mode
BFF URL: https://2e673f35-blog-bff-dev.contact-ef8.workers.dev
Deploy URL: https://5dbbc279.angular-love-client.pages.dev
Alias URL: https://feature-light-mode.angular-love-client.pages.dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants