Help request; Style element in elm-ui

So, I and my highschool team started using mdgriffith’s elm-ui recently, and found it missing the option to style elements.
For example, we recently tried to add the touch_action: manipulation style element to the website in order for it to stop accidentally zooming on phones.

So, I’d gladly accept any help regarding how to add styling in elm-ui, how to solve this specific example, or any help in general regarding all of the above!

Thanks in advance, from me and my team (◍•ᴗ•◍)

1 Like

You can add a custom style attribute to elm-ui elements like so:

el [ htmlAttribute (Html.Attributes.style "touch-action" "manipulation") ] ...
3 Likes

Thank you!
Now, we are trying to figure out why it doesn’t change the actual style of the html div, and instead adds something like this:

1 Like

The code you’ve highlighted there is the Javascript code that Elm compiles to! It’s usually a bit opaque and you shouldn’t have to look at it.

Also, it looks like your search was for touch_action instead of touch-action – is that the issue?

2 Likes

Well, that seems reasonable- but it yields no results… :persevere:
image

You should be able to find touch-action in the rendered html:

Here’s a link to the Ellie session: https://ellie-app.com/7WTRdxQbhYja1

3 Likes

Thank you!
Honestly, I’m really glad that there is such a supportive community here :smile:
It amazes me how the answers came from different people each time!

5 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.