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

Prelight tailwind making type submit to be brackground transparent #10

Open
kutyel opened this issue Dec 25, 2023 · 3 comments
Open

Prelight tailwind making type submit to be brackground transparent #10

kutyel opened this issue Dec 25, 2023 · 3 comments

Comments

@kutyel
Copy link

kutyel commented Dec 25, 2023

Hi! I'm using elm-land with default-tailwind-modules, and even though I'm correctly setting the bg color for my button type=submit, the background is still transparent! I think this is an issue related to this behaviour in tailwind:

Here is the relevant View.elm file, in case it helps to debug what is wrong:

toBrowserDocument :
    { shared : Shared.Model.Model
    , route : Route ()
    , view : View msg
    }
    -> Browser.Document msg
toBrowserDocument { view } =
    let
        screen : Html msg
        screen =
            Html.div [] <|
                Css.Global.global Tw.globalStyles
                    :: view.body
    in
    { title = view.title
    , body = [ Html.toUnstyled screen ]
    }

Thanks in advance!

@matheus23
Copy link
Owner

matheus23 commented Dec 27, 2023

What happens if you try doing this:

toBrowserDocument :
    { shared : Shared.Model.Model
    , route : Route ()
    , view : View msg
    }
    -> Browser.Document msg
toBrowserDocument { view } =
    let
        screen : Html msg
        screen =
            Html.div [] (view.body ++ [ Css.Global.global Tw.globalStyles ])
    in
    { title = view.title
    , body = [ Html.toUnstyled screen ]
    }

Does this also happen without elm-land?

@kutyel
Copy link
Author

kutyel commented Dec 28, 2023

The same, I'm not sure if it is elm-land fault but I think the issue is that the global styles are loading after my custom tailwind styles and therefore overriding the thing 😟

@ryannhg any input you could give, is this maybe not the correct way to do tailwind in elm-land? 👀

@matheus23
Copy link
Owner

yeah - unfortunately tailwind working correctly depends on the order that styles are loaded in.
Usually looking at the generated HTML in the browser DevTools should be enough to verify that global styles come first.

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