Refactor CSS to BEM

Update dependencies
Improve focus and hover states
This commit is contained in:
2018-12-09 14:52:01 +00:00
parent e9f1f6e2fa
commit 6e62b55e60
34 changed files with 3934 additions and 2384 deletions

View File

@@ -28,14 +28,14 @@ export default class Navigation {
this.menu.container.addEventListener('click', () => {
this.openNav();
});
this.container.querySelector('.Nav-close').addEventListener('click', () => {
this.container.querySelector('.nav__close').addEventListener('click', () => {
this.closeNav();
});
}
attachKeyEvents() {
const first = this.container.querySelector('.Nav-link');
const last = this.container.querySelector('.Nav-close');
const first = this.container.querySelector('.nav__link');
const last = this.container.querySelector('.nav__close');
this.container.addEventListener('keydown', (e) => {
if (e.keyCode === 27) {
this.closeNav();
@@ -61,7 +61,7 @@ export default class Navigation {
this.menu.hideMenu();
this.container.classList.add(STATES.open);
this.container.setAttribute('aria-hidden', false);
this.container.querySelector('.Nav-titleLink').focus();
this.container.querySelector('.nav__title-link').focus();
}
closeNav() {