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

Consider doing this via CSS #4

Open
ypantig opened this issue Jun 19, 2019 · 0 comments
Open

Consider doing this via CSS #4

ypantig opened this issue Jun 19, 2019 · 0 comments

Comments

@ypantig
Copy link

ypantig commented Jun 19, 2019

To lessen the use of JavaScript, consider using :before or :after pseudo-classes to add the arrow.

Using the JavaScript method as you have now also hardcodes the arrows to these specific elements which will no longer work in case the client decides to change the menu items.

let arrowDown = '<button class="arrow-down"></button>';

You could do something like:

.menu-page-has-children::after {
    content: '';
    background-image: url(../../assets/vector-icons/icons/chevrons/down.svg);
}

Essentially the same styling for your .arrow-down class for the pseudo element.

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

1 participant