Skip to content

Updated sponsor label color web rendering for CTA card#22530

Merged
ronaldlangeveld merged 1 commit intomainfrom
sponsor-label-color
Mar 18, 2025
Merged

Updated sponsor label color web rendering for CTA card#22530
ronaldlangeveld merged 1 commit intomainfrom
sponsor-label-color

Conversation

@sanne-san
Copy link
Contributor

Ref https://linear.app/ghost/issue/PLG-370/fix-sponsor-label-rendering-on-web

  • With the sponsor label being stripped of the p tag, the color was not being applied correctly.
  • Added hover state to the sponsor label and text links

Ref https://linear.app/ghost/issue/PLG-370/fix-sponsor-label-rendering-on-web
- With the sponsor label being stripped of the p tag, the color was not being applied correctly.
- Added hover state to the sponsor label and text links
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 17, 2025

Walkthrough

This pull request refines the CSS styling for call-to-action elements. The changes simplify and update the selectors targeting sponsor labels and text. In particular, the selector .kg-cta-sponsor-label p span:not(a span) is simplified to better target spans, and transition effects have been added for both anchor tags and their nested spans. Adjustments include adding hover states with modified opacity (0.85) for improved visual feedback. Additionally, the transition duration for the call-to-action button is modified from 0.2 seconds to 0.15 seconds to maintain a consistent feel across elements. These modifications ensure that the styling for the call-to-action components is more streamlined and uniform.

Possibly Related PRs

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

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.

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 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
Contributor

@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: 0

🧹 Nitpick comments (1)
ghost/core/core/frontend/src/cards/css/cta.css (1)

75-77: Selector Refinement & Color-Mix Usage:
The updated selector .kg-cta-sponsor-label span:not(a span) correctly reflects the removal of the <p> tag, ensuring that the color is now applied directly to the desired span elements. One note: the use of color-mix(in srgb, currentColor 45%, transparent) is modern and may not be fully supported in all browsers. Please verify that this approach works across all target environments or consider a fallback strategy if needed.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a9286a8 and 8d01001.

📒 Files selected for processing (1)
  • ghost/core/core/frontend/src/cards/css/cta.css (3 hunks)
🔇 Additional comments (5)
ghost/core/core/frontend/src/cards/css/cta.css (5)

79-83: Unified Link Styling for Sponsor Label:
The new CSS block targeting .kg-cta-sponsor-label a, .kg-cta-sponsor-label a span sets the color and applies the transition of opacity 0.15s ease-in-out. This ensures consistency in the visual behavior of links within the sponsor label. The change is aligned with the PR objective and overall design.


85-89: Hover State Enhancement for Sponsor Label Links:
The addition of the hover state with selectors .kg-cta-sponsor-label a:hover, .kg-cta-sponsor-label a:hover span that sets opacity: 0.85 provides clear visual feedback on interaction. This change is consistent with the design improvements outlined in the PR.


182-186: Consistent Transition for Text Links:
The updated rule for .kg-cta-text a now includes a transition to opacity 0.15s ease-in-out, which matches the hover transition used in other elements. This helps maintain a uniform user interaction experience across call-to-action components.


187-190: Hover State for Text Links:
The hover state for .kg-cta-text a:hover setting opacity: 0.85 is in line with the updated UI behavior for sponsor labels, ensuring consistency in user feedback upon interaction with text links.


205-205: Button Transition Duration Update:
The modification of the transition duration for the call-to-action button (a.kg-cta-button) to opacity 0.15s ease-in-out now aligns with the transitions applied to other interactive elements on the card. This consistency reinforces the overall design coherence.

@ronaldlangeveld ronaldlangeveld merged commit 13aca81 into main Mar 18, 2025
26 checks passed
@ronaldlangeveld ronaldlangeveld deleted the sponsor-label-color branch March 18, 2025 04:24
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