Skip to content
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

3010: Styling for contact cards #3075

Merged
merged 9 commits into from
Feb 11, 2025
Merged

Conversation

bahaaTuffaha
Copy link
Contributor

Short Description

Regions will be able to insert contact cards into pages. While the CMS/api will provide the HTML markup for the card ready-to-use, styling should be handled by the app.

Proposed Changes

  • I added contact-card class to both web and native similar to the class provided in the description of this Task.
  • Used the background image same as the one from cms as base64.
  • Removed some unnecessary properties from that provided class like cursor, color, text-decoration, white-space as they don't add anything could change this styling.

Side Effects

  • It affects anything using class contact-card at the remote content.

Testing

Resolved Issues

Fixes: #3010


Copy link
Contributor

@lunars97 lunars97 left a comment

Choose a reason for hiding this comment

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

Thank you for your PR 🎆 Looks really good. Tested on Android and Chrome.
One more thing: Probably we need a release note for this?

Copy link
Member

@steffenkleinle steffenkleinle left a comment

Choose a reason for hiding this comment

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

Looks very good! My css knowledge is very limited, so would be cool if someone else could have a quick look here, e.g. @f1sh1918. From my point of view this would be good to go, with some small possible improvements. Thanks :)

All the things commented on web are also meant for native if possible :)

web/src/components/RemoteContentSandBox.ts Outdated Show resolved Hide resolved
web/src/components/RemoteContentSandBox.ts Outdated Show resolved Hide resolved
web/src/components/RemoteContentSandBox.ts Outdated Show resolved Hide resolved
web/src/components/RemoteContentSandBox.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@LeandraH LeandraH left a comment

Choose a reason for hiding this comment

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

Looks great, nicely done! Tested on emulated iOS and Firefox

native/src/utils/renderHtml.ts Outdated Show resolved Hide resolved
@LeandraH LeandraH enabled auto-merge February 11, 2025 15:46
@charludo
Copy link
Contributor

charludo commented Feb 11, 2025

Hi, sorry to chime in, we recently noticed on the cms side that for small contact cards, a weird black line appears due to the styles below and slightly changed them. See this PR for details. It would be great if that could be changed here as well 🙈

The new styling, in its totally, is:

.contact-card {
    display: inline-block;
    box-sizing: border-box;
    padding: 1rem;
    border-radius: 0.25rem;
    background-repeat: no-repeat;
    background-color: rgba(127, 127, 127, 0.15);
    background-image: linear-gradient(to right, rgba(255, 255, 255, 0.9) 0 100%), url("../svg/contact.svg");
    background-blend-mode: difference;
    background-position:
        calc(100% + 2em) calc(100% + 0em),
        calc(100% + 1.5em) calc(100% + 1.5em);
    background-size: 6.5em;
    box-shadow: 0 0.1em 0.1em rgba(0, 0, 0, 0.4);
    color: initial;
    text-decoration: initial;
    min-width: 50%;
    white-space: initial;

    p {
        margin: 4px 0 0 0;
    }

    h4 {
        margin: 0 0 12px 0;
    }

    img {
        margin: 0 8px 0 0;
    }
}

in the CMS. Specifically, the line that changed is:

    background-position:
        calc(100% + 2em) calc(100% + 0em),
        calc(100% + 1.5em) calc(100% + 1.5em);
    background-size: 6.5em;

@LeandraH LeandraH disabled auto-merge February 11, 2025 15:48
@charludo
Copy link
Contributor

image

Hahaha, sorry 😂 🙈

@LeandraH
Copy link
Contributor

Good timing 😂

@LeandraH LeandraH enabled auto-merge February 11, 2025 16:01
@LeandraH
Copy link
Contributor

@charludo Last chance for more requests 🤣

Copy link
Contributor

@charludo charludo left a comment

Choose a reason for hiding this comment

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

LGTM 😄

@LeandraH LeandraH merged commit 8120e0a into main Feb 11, 2025
6 checks passed
@LeandraH LeandraH deleted the 3010-styling-for-contact-cards branch February 11, 2025 16:08
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.

Add styling for contact cards
5 participants