gijsroge / priority-navigation

Javascript implementation for Priority+ Navigation — no dependencies
http://gijsroge.github.io/priority-nav.js/
MIT License
768 stars 109 forks source link

Can the button element be customised/changed ? #38

Open chris-sparks opened 6 years ago

chris-sparks commented 6 years ago

I'd like to be able to use, say, a burger menu like SVG icon in place of the button element.

Is this possible or are there any future plans to accommodate customisation of this element?

Regards Chris

derpyherp commented 6 years ago

I use the unicode character "☰" for navDropdownLabel and navDropdownBreakpointLabel in priority-nav.js, and style the button using CSS to match the rest of my menu.

I suppose alternatively you could give the button a SVG background using CSS.

rastapopougros commented 5 years ago

Maybe we could have a setting to customize the HTML but, in many many cases, this is just a decoration problem. And decoration must be in CSS.

Also, for accessibility, the button MUST have a real human label. You can accessibly hide it with CSS (there is technics) and put other things in :before or :after for exemple. (Maybe a span would be good inside the button to facilitate manipulation.)