Skip to content

feat: enable light mode #255

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 14 commits into
base: main
Choose a base branch
from
Open

feat: enable light mode #255

wants to merge 14 commits into from

Conversation

DDonochVA
Copy link
Contributor

@DDonochVA DDonochVA commented Jul 12, 2024

Summary by CodeRabbit

  • New Features

    • Introduced dynamic light and dark theme support, automatically adapting to user system preferences.
    • Added new color tokens and improved color palette for enhanced visual consistency.
  • Enhancements

    • Updated visual styling across multiple components, including cards, headings, footers, navigation, and buttons, for better readability and theme alignment.
    • Improved image loading and prioritization in article cards for better performance and user experience.
    • Enhanced card and pill components with refined background and text color styles.
    • Enabled standalone usage for key author and article card components.
  • Bug Fixes

    • Removed duplicate imports in article components for cleaner operation.
  • Chores

    • Added a new dependency for theme variant management.
    • Updated Tailwind CSS configuration to support media-query-based theming.

Copy link

cloudflare-workers-and-pages bot commented Jul 12, 2024

Deploying angular-love-client with  Cloudflare Pages  Cloudflare Pages

Latest commit: dee6e92
Status: ✅  Deploy successful!
Preview URL: https://0ee79d11.angular-love-client.pages.dev
Branch Preview URL: https://feat-enable-light-mode.angular-love-client.pages.dev

View logs

@DDonochVA DDonochVA force-pushed the feat/enable-light-mode branch 2 times, most recently from 9c15b33 to 6a5dbae Compare July 12, 2024 09:28
@DDonochVA
Copy link
Contributor Author

do not merge until we get a final decision

@dokolyski
Copy link
Contributor

Some components in the light mode design didn't match the light color palette. The solution is based on light: dark: tailwind modificators and uses custom styles instead of palette colors

@DamianBrzezinskiHoA DamianBrzezinskiHoA force-pushed the feat/enable-light-mode branch 2 times, most recently from 61a7ec4 to 5773b00 Compare September 27, 2024 11:28
@dokolyski dokolyski force-pushed the feat/enable-light-mode branch from 8bc32d7 to bddb5d1 Compare September 30, 2024 12:02
@dokolyski dokolyski force-pushed the feat/enable-light-mode branch from bddb5d1 to f23d6c9 Compare October 4, 2024 08:53
Copy link

coderabbitai bot commented May 8, 2025

Walkthrough

This update introduces comprehensive visual and theming enhancements across the project. It adds support for light and dark color schemes using new CSS variables, updates Tailwind and component styles, and modifies several Angular components to utilize dynamic color classes and improved image handling. New dependencies and configuration for theme variants are included.

Changes

File(s) Change Summary
libs/shared/assets/src/lib/styles/main.scss, tailwind.preset.js, package.json Added CSS variables for light/dark themes, updated Tailwind config for theme variants, and added tailwindcss-theme-variants dependency.
libs/blog/shared/ui-card/src/lib/card.component.ts, libs/blog/shared/ui-card/src/lib/card.stories.ts Updated card and gradient card background classes; added transparent background in story.
libs/blog/articles/ui-article-card/src/lib/components/article-compact-card/article-compact-card.component.ts Made component standalone, added NgOptimizedImage, introduced imagePriority input.
libs/blog/articles/ui-article-card/src/lib/components/article-compact-card/article-compact-card.component.html Switched background image to <img>, updated classes for layout and image priority.
libs/blog/articles/ui-article-card/src/lib/components/article-hero-card/article-hero-card-skeleton.component.ts Made card background transparent.
libs/blog/articles/ui-article-card/src/lib/components/article-horizontal-card/article-horizontal-card.component.html Updated article element classes: removed max height, added light mode border.
libs/blog/articles/ui-article-card/src/lib/components/article-regular-card/article-regular-card.component.html Enhanced border, text, and image priority styling.
libs/blog/articles/ui-article-card/src/lib/ui-article-card/ui-article-card.component.html Passed imagePriority input to compact card.
libs/blog/articles/feature-latest-articles/src/lib/feature-latest-articles/feature-latest-articles.component.ts Removed duplicate CardComponent import.
libs/blog/articles/ui-article-list-title/src/lib/ui-article-list-title/ui-article-list-title.component.html, libs/blog/newsletter/feature-newsletter/src/lib/feature-newsletter/newsletter.component.html Added text-al-primary-foreground class to headings.
libs/blog/about-us/feature-about-us/src/lib/feature-about-us/feature-about-us.component.html Applied text-al-primary-foreground to headings and made card background transparent.
libs/blog/authors/ui-author-card/src/lib/author-card/author-card-template.component.ts Made component standalone, updated background classes, added directives for gradient and content.
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/become-author-page/become-author-page.component.html Added text-white to button texts.
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, minor attribute/order tweaks.
libs/blog/layouts/ui-layouts/src/lib/footer/footer.component.html Changed footer background to hex color, updated navigation and copyright.
libs/blog/layouts/ui-layouts/src/lib/footer/components/footer-logo.component.ts, libs/blog/layouts/ui-layouts/src/lib/footer/components/footer-social-media-icons.component.ts Changed text color classes to explicit hex colors.
libs/blog/layouts/ui-navigation/src/lib/navigation/navigation.component.html, libs/blog/layouts/ui-navigation/src/lib/navigation/navigation.component.ts Added whiteFont input and dynamic class binding for font color.
libs/blog/partners/ui-partners/src/lib/partners-list/partners-list.component.html Added light mode border and rounded classes to partner links.
libs/blog/shared/ui-difficulty/src/lib/ui-difficulty.component.ts Updated background and shadow classes for light/dark mode support.
libs/blog/shared/ui-social-media-icons/src/lib/social-media-icons.component.html Set social media icon text color to white.
libs/blog/writing-rules/feature-writing-rules/src/lib/rules-row/rules-row.component.html Added text-white to badge and button.
libs/blog/shared/ui-pill/src/lib/pill.directive.ts Added text-white class to "flat" variant styling.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Browser
    participant AngularApp
    participant TailwindCSS
    participant ThemeVariantsPlugin

    User->>Browser: Loads site
    Browser->>TailwindCSS: Applies styles
    TailwindCSS->>ThemeVariantsPlugin: Detects color scheme (light/dark)
    ThemeVariantsPlugin-->>TailwindCSS: Applies appropriate theme variables
    AngularApp->>Browser: Renders components with dynamic classes
    Browser->>User: Displays themed UI with updated styling and images
Loading

Possibly related PRs

Suggested reviewers

  • DDonochVA

Poem

🐇
A hop and a skip, a theme in the air,
Colors now shift with the system’s care.
Cards shine transparent, icons glow white,
Navigation adapts from dark into light.
With image priority and gradients anew,
This rabbit’s delighted—so should be you!
🌈

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 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 9dc3a6a and 952c642.

📒 Files selected for processing (1)
  • libs/blog/shared/ui-pill/src/lib/pill.directive.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • libs/blog/shared/ui-pill/src/lib/pill.directive.ts
✨ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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: 2

♻️ Duplicate comments (1)
libs/blog/layouts/ui-navigation/src/lib/navigation/navigation.component.ts (1)

35-35: Consider renaming the whiteFont property to better reflect its purpose.

The name whiteFont is implementation-specific rather than intent-specific. Consider using a more semantic name such as contrastText, inverseForeground, or alternateTextColor to better express the property's purpose rather than the specific color.

As noted in a previous review, naming the property by its meaning rather than the specific color implementation would make the code more maintainable as themes evolve.

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

1-54: Consider adding skeleton loader theme adjustments for light mode.

The skeleton loader uses default styling, but might benefit from theme-specific adjustments for better visual harmony in light mode. Consider using CSS variables or Tailwind's theme variants to adjust the skeleton appearance based on the current theme.

 <ngx-skeleton-loader
   class="block h-8"
   [appearance]="'circle'"
   [theme]="{
     height: '32px',
     width: '32px',
     margin: '0',
+    backgroundColor: 'var(--skeleton-color)',
   }"
 />

You could define --skeleton-color in your theme CSS with appropriate values for light and dark modes.

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

11-13: Consider using utility classes or design tokens instead of explicit hex.

Using text-[#fff] works but may reduce readability and consistency. Prefer the built-in text-white class or a design token like text-al-foreground for clarity and maintainability:

- class="mb-4 hidden text-sm font-bold text-[#fff] lg:block"
+ class="mb-4 hidden text-sm font-bold text-white lg:block"
libs/blog/layouts/ui-layouts/src/lib/footer/components/footer-logo.component.ts (1)

19-21: Ensure contrast consistency in dark mode.

The explicit text-[#bec4ca] color will apply in all modes, which may reduce contrast on dark backgrounds. Consider using a theme variant or design token that adapts per mode, for example:

- <small class="hidden pt-1 text-xs text-[#bec4ca] lg:block">
+ <small class="hidden pt-1 text-xs light:text-[#bec4ca] dark:text-al-muted lg:block">

This approach ensures the muted text is optimized for both light and dark themes.

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

3-3: Specify border color when enabling light:border.

Using light:border adds the border style but relies on the default color. To ensure consistent theming, explicitly set the border color for light mode:

- class="light:border group relative flex h-full w-full flex-row rounded-lg shadow-none"
+ class="light:border light:border-al-border group relative flex h-full w-full flex-row rounded-lg shadow-none"

This ties the border color to your design token under light mode.

libs/blog/shared/ui-social-media-icons/src/lib/social-media-icons.component.html (1)

4-7: Prefer semantic utility over raw hex color
While text-[#fff] enforces a white icon color, consider using a semantic utility class like text-white or a design-token class (e.g., text-al-foreground) to maintain consistency and readability.

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

4-4: Remove trailing comma in ngClass object
Although JavaScript allows trailing commas, removing it avoids potential linting warnings in Angular template expressions and keeps the object literal clean.


15-15: Consider attribute ordering for readability
Swapping class before size improves consistency with other components. While not functionally required, you may wish to standardize attribute order (static first, then inputs).

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

24-26: DRY up repeated class and style bindings
The class="p-2 font-medium md:p-6" and theme-aware [ngClass] logic is duplicated for both internal and external links. Consider extracting this into a shared directive or consolidating into a single [ngClass] expression to reduce duplication and improve maintainability.

Also applies to: 37-39

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

1-1: Consider using theme variables instead of hardcoded colors for better theme flexibility

You've changed the footer background from bg-al-card to a hardcoded hex color bg-[#191a22]. While this ensures the footer remains dark in both themes, it creates a maintenance challenge if the design system colors change in the future.

Consider using Tailwind's dark mode variant to achieve the same effect but with better maintainability:

-<footer class="w-full bg-[#191a22]">
+<footer class="w-full bg-white dark:bg-[#191a22]">

Or even better, use your theme variables:

-<footer class="w-full bg-[#191a22]">
+<footer class="w-full dark:bg-al-card bg-al-grey">

13-13: Consider using theme variables for text color

Similar to the background color, you've changed the copyright text color from text-al-muted to a hardcoded hex color text-[#6a798b].

For better maintainability, consider using the theme variables:

-<small class="copyright text-center text-xs text-[#6a798b] lg:hidden">
+<small class="copyright text-center text-xs text-al-muted lg:hidden">
libs/shared/assets/src/lib/styles/main.scss (1)

19-30: Consider adding a class-based theme toggle for more control

While using the prefers-color-scheme media query is excellent for respecting user preferences, many applications also offer a manual toggle to override the system preference.

Consider implementing a class-based theme toggle in addition to the media query:

/* In addition to the media query */
:root.light-theme {
  --primary: 213 1 89;
  --foreground: 20 21 27;
  /* rest of the light theme variables */
}

Then you can add/remove the light-theme class via JavaScript when users toggle their preference.

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

3-3: Consider using a theme-aware background color

You're using bg-black which will remain black in both light and dark modes. If this is an article card, it might be better to adapt to the current theme.

If the card should adapt to the theme:

-class="relative h-full overflow-hidden rounded-lg bg-black bg-cover bg-no-repeat transition-transform hover:scale-105 motion-reduce:transition-none motion-reduce:hover:scale-100"
+class="relative h-full overflow-hidden rounded-lg bg-al-background bg-cover bg-no-repeat transition-transform hover:scale-105 motion-reduce:transition-none motion-reduce:hover:scale-100"

If the card should remain dark regardless of theme:

-class="relative h-full overflow-hidden rounded-lg bg-black bg-cover bg-no-repeat transition-transform hover:scale-105 motion-reduce:transition-none motion-reduce:hover:scale-100"
+class="relative h-full overflow-hidden rounded-lg dark:bg-black bg-gray-900 bg-cover bg-no-repeat transition-transform hover:scale-105 motion-reduce:transition-none motion-reduce:hover:scale-100"
libs/blog/articles/ui-article-card/src/lib/components/article-regular-card/article-regular-card.component.html (1)

48-48: Consider making excerpt text theme-aware

While the article title uses theme-aware coloring (text-al-primary-foreground), the excerpt text uses a fixed color (text-al-pink). Consider making this theme-aware as well to ensure proper contrast in both light and dark modes.

- <p class="*:text-al-pink line-clamp-2 *:font-medium *:not-italic">
+ <p class="*:text-al-primary-foreground line-clamp-2 *:font-medium *:not-italic">
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b90e11a and 97ac58b.

⛔ 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 (29)
  • 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-advertisement/become-author-advertisement.component.ts (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 (1 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-navigation/src/lib/navigation/navigation.component.html (2 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-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 (40)
package.json (1)

67-67: Verify tailwindcss-theme-variants beta version compatibility and stability.

The new dependency tailwindcss-theme-variants is added at version 2.0.0-beta.0, which is a beta release. While this plugin is essential for enabling the light/dark mode implementation, using beta versions in production can introduce stability risks.

#!/bin/bash
# Check for the latest version of tailwindcss-theme-variants and any related issues
npm view tailwindcss-theme-variants versions
npm view tailwindcss-theme-variants repository

# Check if there are more recent versions or tags available
echo "Checking GitHub repository for more recent releases..."
REPO_URL=$(npm view tailwindcss-theme-variants repository.url 2>/dev/null | sed 's/git+//;s/.git$//')
if [ -n "$REPO_URL" ]; then
  gh api repos/${REPO_URL#https://github.com/}/releases --jq '.[0:3] | .[] | {tag_name, published_at, prerelease}'
fi
libs/blog/writing-rules/feature-writing-rules/src/lib/rules-row/rules-row.component.html (2)

14-14: Text color explicitly set for better contrast.

Adding the text-white class ensures proper contrast against the pink background, which is important for accessibility in both light and dark modes.


49-49: Consistent text styling for the action button.

The text-white class ensures proper visibility of the button text against the pink background, maintaining consistent styling across the light and dark themes.

libs/blog/layouts/ui-navigation/src/lib/navigation/navigation.component.ts (1)

1-36:

✅ Verification successful

Verify that all component consumers are updated to use the new whiteFont property.

Since this component introduces a new input property, ensure that all instances of <al-navigation> in the codebase properly set this property, particularly in components that were previously relying on default text coloring.


🏁 Script executed:

#!/bin/bash
# Find all usages of the al-navigation component in the codebase
echo "Checking for usages of al-navigation in the codebase:"
rg -A 2 -B 2 "<al-navigation" --type html

echo "Checking specifically for instances with whiteFont property:"
rg -A 2 -B 2 "\[whiteFont\]" --type html

Length of output: 1448


No action needed: whiteFont is set on all <al-navigation> consumers

  • Search for <al-navigation> and [whiteFont] returned a single instance in libs/blog/layouts/ui-layouts/src/lib/footer/footer.component.html, which already uses [whiteFont]="true".
    All consumers are up-to-date.
libs/blog/articles/ui-article-card/src/lib/components/article-hero-card/article-hero-card-skeleton.component.ts (1)

10-10: Background made transparent for theme compatibility.

Setting the card background to transparent allows it to adapt to the surrounding container's background color, which is essential for proper light/dark mode implementation. This change enables the component to respect the parent container's theme context.

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

61-65: Transparent background for card story is appropriate.

Adding bg-transparent ensures the card renders without its default background, matching other stories and highlighting content correctly under both light and dark themes.

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

7-9: Great: Applied theme-aware design token for heading color.

Using text-al-primary-foreground ensures the newsletter title adapts correctly across light and dark modes, leveraging your Tailwind theme configuration.

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

6-6: Correctly applied light mode utilities
The light:border and light:rounded-lg classes are added appropriately to enable light-theme borders and corners without impacting the existing dark-mode styling.

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

45-45: Standardize author name color with theme token
Adding text-al-foreground ensures the author’s name uses the designated foreground color token in both light and dark modes, aligning with other components.

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

4-4: Align heading color with primary foreground token
The text-al-primary-foreground class correctly applies the theme’s primary text color, ensuring visual consistency for titles across light and dark modes.

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

11-11: Ensure badge text remains legible
The text-white class is necessary here to guarantee contrast against the pink background, so this addition is appropriate.

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

15-18: Ensure image priority consistency across card variants
Nice catch adding [imagePriority]="imagePriority()" to the compact card. This brings the compact variant in line with the regular and horizontal cards and ensures all images respect the same loading priority.

libs/blog/become-author/feature-become-author-page/src/lib/components/become-author-advertisement/become-author-advertisement.component.ts (1)

2-2: Add TranslocoDirective to standalone component imports
Importing TranslocoDirective and adding it to the imports array enables template-level translation support. Ensure that @jsverse/transloco is listed in your dependencies and that this directive is compatible with standalone components.

Also applies to: 13-13

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

34-36: Consistent button text color on call-to-action
Great addition of text-white for the button text: it ensures clear contrast against the pink background.


64-66: Maintain uniform styling for secondary action buttons
Adding text-center text-sm font-bold text-white aligns the article rules button with the primary CTA styling—this maintains visual consistency.

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

2-4: Apply primary-foreground token to page title
Adding text-al-primary-foreground ensures the title adapts to the new theming tokens—this matches other modules and improves consistency.


6-7: Use transparent background for card container
bg-transparent allows the card to inherit the parent’s background, which is necessary for theme-driven backgrounds. Verify it renders correctly in both light and dark contexts.


38-40: Apply primary-foreground token to authors section title
Consistent with the main title, adding text-al-primary-foreground here aligns the authors title with the updated design language.

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

6-6: Good addition of conditional text coloring

Adding the [whiteFont]="true" input to the navigation component properly supports the theming approach by allowing conditional text coloring in the navigation.

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

11-11: Good addition of new color variables to the theme system

The addition of --primary-foreground and --grey variables to the default theme is appropriate and follows the established pattern.

Also applies to: 16-16


19-30: Well-implemented light theme using media queries

The implementation of the light theme using CSS variables and the prefers-color-scheme: light media query is well done. This allows the application to automatically switch between dark and light themes based on the user's system preferences.

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

6-13: Good use of NgOptimizedImage for performance

Using NgOptimizedImage with the priority attribute is a good practice for optimizing image loading performance, especially for above-the-fold content.

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

72-72: Good implementation of conditional theming

The updated GradientCardDirective now properly uses the dark mode variant (dark:bg-al-background) with the gradient background, allowing it to adapt to the current theme.


100-100: Good addition of theme-aware background to the card component

Adding the bg-al-card class to the card component correctly integrates it with the theming system, allowing cards to adapt their background color to the current theme.


100-100:

❓ Verification inconclusive

Verify accessibility contrast with the new background

With the addition of the bg-al-card background, ensure that text elements within cards maintain sufficient contrast in both light and dark modes.


🌐 Web query:

What is the recommended contrast ratio for text accessibility according to WCAG standards?

💡 Result:

Recommended Contrast Ratio for Text Accessibility (WCAG Standards)

WCAG (Web Content Accessibility Guidelines) standards set specific minimum contrast ratios to ensure text is readable for users with visual impairments. The requirements vary by compliance level and text size:

Level AA (Minimum Accessibility)

  • Normal text: A contrast ratio of at least 4.5:1 between the text and its background is required[1][2][3][5][9][10].

  • Large text: The minimum ratio lowers to 3:1 for large-scale text because it is generally easier to perceive[1][2][3][5][9][10].

    • Large text is defined as 18pt (24px) regular or 14pt (19px) bold or larger[6][9][10].

Level AAA (Enhanced Accessibility)

  • Normal text: A higher contrast ratio of at least 7:1 is required[5][6][9][10].
  • Large text: The minimum ratio is 4.5:1[5][6][9][10].

Special Cases

  • Logotypes (logos, brand names): No contrast requirement[1][2][3].
  • Incidental or decorative text: No contrast requirement[1][2][3].

Summary Table

Compliance Level Normal Text Large Text
WCAG AA 4.5:1 3:1
WCAG AAA 7:1 4.5:1

In practice: To meet most organizational and legal requirements, content creators should ensure normal text meets at least a 4.5:1 contrast ratio and large text meets at least a 3:1 ratio[3][5][9][10].

References to the guidelines can be found in the official W3C documentation and accessibility checkers such as WebAIM, Accessible Web, and institutional brand guidelines.

Citations:


Verify card text contrast meets WCAG AA standards

With the new bg-al-card background, ensure all text inside the card maintains at least:

  • 4.5:1 contrast ratio for normal-sized text
  • 3:1 contrast ratio for large text (≥18 pt/24 px or ≥14 pt/19 px bold)

Check both light and dark mode variants using a contrast checker (e.g., WebAIM Contrast Checker) to confirm compliance.

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

3-3: Good implementation of theme-aware borders

The border styling has been properly updated to be visible in light mode while remaining transparent in dark mode, which aligns with the light mode feature implementation.


21-25: Nice touch adding image priority to the avatar

The addition of the [priority]="imagePriority()" binding improves performance by properly prioritizing the loading of avatar images.


26-26: Well-implemented foreground text styling

Using text-al-primary-foreground ensures the author name will have proper contrast in both light and dark modes.


41-45: Properly implemented heading text styling

The heading now has appropriate theme-aware text color and consistent styling with *:text-al-primary-foreground and *:not-italic.

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

28-38: Good conversion to al-card with proper directives

The nested card is now properly implemented using the <al-card> component with appropriate directives, which will ensure consistent styling across the application.

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

28-30: Well-implemented theme-aware background for left block

The background styling has been properly updated to support both light and dark modes, using transparent backgrounds in light mode and proper background colors in dark mode.


47-50: Good update to shadow styling for dot containers

The shadow styling has been properly updated to be transparent in light mode and use the appropriate shadow color in dark mode, creating a consistent visual appearance across themes.


80-82: Well-implemented theme-aware background for right block

The background styling has been properly updated to support both light and dark modes, matching the left block's implementation for consistency.


19-22: Verify difficulty indicator contrast in light mode

Please verify that the difficulty indicator maintains sufficient contrast in light mode, especially for the text and dots. The container now uses a transparent background in light mode which might affect readability depending on what's beneath it.

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

1-1: Good conversion to standalone component with image optimization

The component has been properly converted to a standalone component with all necessary imports, including NgOptimizedImage for better image loading performance.

Also applies to: 13-20


25-25:

✅ Verification successful

Good addition of imagePriority input

The new imagePriority input allows for controlling image loading priority, which is important for performance optimization. This matches the implementation in the regular card component.

Make sure this property is properly used in the HTML template (not shown in this review) to prioritize the loading of featured images.


🏁 Script executed:

#!/bin/bash
# Check if the imagePriority input is used in the HTML template
cat libs/blog/articles/ui-article-card/src/lib/components/article-compact-card/article-compact-card.component.html | grep -A 5 -B 5 "priority"

Length of output: 493


Confirmed: imagePriority input is implemented and used correctly

The imagePriority input is added in the component and is referenced in the template as [priority]="imagePriority()", mirroring the regular card component’s behavior. No further changes needed.

tailwind.preset.js (4)

1-5: Good implementation of system-preference based theming.

The integration of tailwindcss-theme-variants plugin is a good approach for enabling system-driven light and dark themes. Using media queries instead of class toggling is more user-friendly as it automatically adapts to user preferences.


13-14: New color tokens follow consistent naming patterns.

The additions of al-primary-foreground and al-grey follow the existing naming conventions and properly leverage CSS variables with alpha value support, maintaining consistency with the rest of the color tokens.

Also applies to: 22-22


39-51: Good plugin configuration for theme variants.

The plugin configuration correctly sets up light and dark themes using the appropriate media queries. This enables automatic theme switching based on system preferences, which improves user experience.

Note that this approach requires corresponding CSS variables to be defined for both themes in your stylesheet, which according to the summary are added in libs/shared/assets/src/lib/styles/main.scss.


35-35:

❓ Verification inconclusive

Verify the visual impact of changing box shadow variable.

The change from --border to --grey for the al-full-border box shadow might have visual implications. Ensure this change aligns with the design specifications for both light and dark modes.


🏁 Script executed:

#!/bin/bash
# Check where the al-full-border shadow is being used in the codebase
rg "al-full-border" --type html --type css --type scss

Length of output: 83


🏁 Script executed:

#!/bin/bash
# Locate the definition in the Tailwind preset
rg "al-full-border" -n tailwind.preset.js

# Search for any usage of the corresponding utility class across markup and scripts
rg "shadow-al-full-border" -n --glob "*.{html,js,ts,jsx,tsx,vue,css,scss}"

Length of output: 318


Verify visual impact of al-full-border change

The al-full-border shadow is now defined as:

// tailwind.preset.js:35
'al-full-border': '0px 0px 0px 999px rgba(var(--grey) / 1)',

and is only applied here:

  • libs/blog/shared/ui-difficulty/src/lib/ui-difficulty.component.ts:49 ('shadow-al-full-border': !isColorBackground())

Please review this change in both light and dark modes against your design specs to ensure the switch from --border to --grey still meets the intended look and accessibility requirements.

width="1215"
height="750"
/>
<div class="relative flex h-full flex-col justify-between text-[#fff]">
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 theme variables for text color instead of hardcoded white

You're using a hardcoded white color (text-[#fff]) which won't adapt to different themes.

For proper theme support, use the foreground color variable:

-<div class="relative flex h-full flex-col justify-between text-[#fff]">
+<div class="relative flex h-full flex-col justify-between text-al-foreground">

If the text should remain white regardless of theme, use the Tailwind class:

-<div class="relative flex h-full flex-col justify-between text-[#fff]">
+<div class="relative flex h-full flex-col justify-between text-white">

@valueadd-robot
Copy link

PR is detected, will deploy to dev environment

@valueadd-robot
Copy link

Deployed to dev environment
Branch: feat/enable-light-mode
BFF URL: https://152b36b3-blog-bff-dev.contact-ef8.workers.dev
Deploy URL: https://89ff2edf.angular-love-client.pages.dev
Alias URL: https://feat-enable-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: feat/enable-light-mode
BFF URL: https://a3047840-blog-bff-dev.contact-ef8.workers.dev
Deploy URL: https://8abebd19.angular-love-client.pages.dev
Alias URL: https://feat-enable-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: feat/enable-light-mode
BFF URL: https://b618ac74-blog-bff-dev.contact-ef8.workers.dev
Deploy URL: https://0ccb64ae.angular-love-client.pages.dev
Alias URL: https://feat-enable-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.

5 participants