Search code examples
accessibilityelmelm-ui

Blue shadow when I click on button


How do I get rid of the blue shadow around buttons when I click on them?

I am building a web app using Elm and mdgriffith/elmui.

Picture of button before click:

enter image description here

And after click:

enter image description here

Elm code:

module Main exposing (main)                                        

import Browser                                                     
import Element as E                                                
import Element.Input as Ei                                         
import Element.Border as Eb                                        

main = E.layout [ E.padding 30 ] <|                                
    Ei.button []                                                   
        { onPress = Nothing                                        
        , label = E.text "A button"                                
        }           

(run it in Ellie)

I don't want to use any CSS, if at all possible.

Edit:

I don't think this is a duplicate, because my question is about how to do this with elm-ui, not with CSS.


Solution

  • To avoid css, consider using layoutWith together with a focusStyle.

    Unfortunately this is global and will apply to all Input elements


    Edit: In practice this looks like

    Element.layoutWith
                { options =
                    [ focusStyle
                        { borderColor = Nothing
                        , backgroundColor = Nothing
                        , shadow = Nothing
                        }
                    ]
                } 
                listOfattrs
                listOfchildren