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

Pseudo element "after" not working #499

Open
bigardone opened this issue Mar 1, 2019 · 1 comment
Open

Pseudo element "after" not working #499

bigardone opened this issue Mar 1, 2019 · 1 comment

Comments

@bigardone
Copy link

bigardone commented Mar 1, 2019

Hi! First of all thanks for your hard work on this awesome library 🙌
I'm trying to add styles to an ::after pseudo-element, but I can't make it work.
I have set up a demo in Ellie of what I'm trying to achieve:

https://ellie-app.com/4RL6hKGYpjJa1

In the demo you can find two different lists, one styled with plain CSS and the other using elm-css:

image

As you can see, I'm adding a separator between the list elements using the pseudo-element after and setting its content to |.
I have tried to replicate the same with elm-css with no luck:

liCss : List Css.Style
liCss =
    [ Css.display Css.inlineBlock
    , Css.marginRight <| Css.rem 1
    , Css.textTransform Css.uppercase
    , Css.after
        [ Css.marginLeft <| Css.rem 1
        , Css.property "content" "|"
        ]
    ]

In fact, using chrome's inspector, there are no ::after elements at all:

image

Whereas in the plain CSS version there are:

image

Is there anything I'm doing wrong? Thanks in advance!

@sporto
Copy link

sporto commented May 31, 2019

I think this is because the content property is invalid.
It renders as content: |. Which then the browser ignores.

It needs to be

Css.property "content" "\"|\""

So it compiles as content: "|"

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

No branches or pull requests

2 participants