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

Offcanvas menu width only for mobile #2

Open
erichstark opened this issue Aug 1, 2019 · 2 comments
Open

Offcanvas menu width only for mobile #2

erichstark opened this issue Aug 1, 2019 · 2 comments

Comments

@erichstark
Copy link

I find out, that style for offcanvas menu width is applied everytime

		.js-hiraku-offcanvas-sidebar-right,
		.js-hiraku-offcanvas-sidebar-left {
			width: 80% !important;
		}
		.js-hiraku-offcanvas-body-right {
			transform: translateX(-80%) !important;
		}
		.js-hiraku-offcanvas-body-left {
			transform: translateX(80%) !important;
		}

I think it should be only for mobile, because it can brake main navigation on desktop.

@steelydylan
Copy link
Contributor

Hi @erichstark

You should use breakpoint option for that

This is the example code.

new Hiraku('.js-hiraku', {
breakpoint: 780
});
``

@erichstark
Copy link
Author

Hi,

actually I did have.

new Hiraku('.js-offcanvas-left', {
  btn: '.js-offcanvas-btn-left',
  fixedHeader: '.js-fixed-header',
  direction: 'left',
  breakpoint: 767,
  width: '80%'
});

new Hiraku('.js-offcanvas-right', {
  btn: '.js-offcanvas-btn-right',
  fixedHeader: '.js-fixed-header',
  direction: 'right',
  breakpoint: 767,
  width: '80%'
});

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

2 participants