Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] Not able to apply CSS styling to Span control #5979

Open
Depechie opened this issue Apr 23, 2019 · 8 comments
Open

[Bug] Not able to apply CSS styling to Span control #5979

Depechie opened this issue Apr 23, 2019 · 8 comments
Assignees
Labels
e/3 🕒 3 help wanted We welcome community contributions to any issue, but these might be a good place to start! t/bug 🐛 up-for-grabs We welcome community contributions to any issue, but these might be a good place to start!

Comments

@Depechie
Copy link
Contributor

Description

Unable to use CSS styling on Span control inside FormattedText of Label.
Although the docs mention this https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/styles/css/ ...

Steps to Reproduce

            <Label>
                <Label.FormattedText>
                    <FormattedString>
                        <Span Text="We want to hear your thoughts! Feel free to join our " />
                        <Span Text="Slack Organization" TextDecorations="Underline" />
                        <Span Text=" or send us an email at " />
                        <Span Text="testing@gmail.com" TextColor="#69d5b1" />
                    </FormattedString>
                </Label.FormattedText>
            </Label> 

We wanted to apply text color and text decoration through CSS styling, but were unable to do so.

Reproduction Link

Repository containing the page https://github.com/Coding-Coach/mobile/blob/556191e0d429a80a036d0928998255654c88d4e4/CodingCoach/CodingCoach/Views/ContactPage.xaml

@Depechie Depechie added s/unverified New report that has yet to be verified t/bug 🐛 labels Apr 23, 2019
@Depechie Depechie changed the title [Bug] [Bug] Not able to apply CSS styling to Span control Apr 23, 2019
@Depechie
Copy link
Contributor Author

hey @StephaneDelcroix are we doing something silly here with css? Or are we reading the docs about css wrong? ( Span and text decoration is mentioned as supported )

@StephaneDelcroix StephaneDelcroix self-assigned this Apr 24, 2019
@PureWeen PureWeen added e/3 🕒 3 and removed s/unverified New report that has yet to be verified labels Apr 29, 2019
@samhouts samhouts added inactive Issue is older than 6 months and needs to be retested help wanted We welcome community contributions to any issue, but these might be a good place to start! up-for-grabs We welcome community contributions to any issue, but these might be a good place to start! labels Oct 21, 2019
@ackava
Copy link

ackava commented May 14, 2020

@Depechie I checked your source code, I couldn't find where have you included your CSS in Resources of either App or the Page?

@Depechie
Copy link
Contributor Author

hey @ackava yeah that was the whole point... it was just not working, so this issue report is a plee for having an example on how to do this. Also more info https://github.com/xamarin/xamarin-forms-samples/issues/457

@ackava
Copy link

ackava commented May 14, 2020

@Depechie I guess its isn't this sufficient?

<Application ...>
    <Application.Resources>
        <StyleSheet Source="/Assets/styles.css" />
    </Application.Resources>
</Application>

Mentioned at https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/styles/css/#xaml

@Depechie
Copy link
Contributor Author

Ow no not that basic... I really did try a full css :)
It just does not pick up the attributes for span inside label.

@Depechie
Copy link
Contributor Author

So for clarification @ackava I wanted to set the Underline in the second Span element in CSS. As the docs mention this should be possible ( https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/styles/css/ ).

But no matter what I put in the styles.css, it would not be applied.

@Depechie
Copy link
Contributor Author

@ackava I found the original link: Coding-Coach/mobile#21 and at that time we talked about it with @StephaneDelcroix and it was said to be a short coming on Span - css in XF. Hence the filed issue.

@samhouts samhouts removed the inactive Issue is older than 6 months and needs to be retested label Jun 5, 2020
@samhouts samhouts added this to the 5.0.0 milestone Aug 13, 2020
@samhouts samhouts removed this from the 5.0.0 milestone Nov 2, 2020
@michelevirgilio
Copy link

+1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
e/3 🕒 3 help wanted We welcome community contributions to any issue, but these might be a good place to start! t/bug 🐛 up-for-grabs We welcome community contributions to any issue, but these might be a good place to start!
Projects
None yet
Development

No branches or pull requests

6 participants