I
I
Illia T2020-07-06 18:02:17
css
Illia T, 2020-07-06 18:02:17

Materialize.css: how to correctly include individual elements of the library?

It's wrong to connect the entire library, I'm trying to connect the necessary components. I can’t figure out why the desired effect doesn’t work (in particular, the hamburger doesn’t work. The menu doesn’t pop up). I connect the necessary components, but there is some kind of hitch: M is not defined, it gives an error.
Here is the code in which the same object M appears, which is supposedly not defined.

document.addEventListener('DOMContentLoaded', function() {
    var elems = document.querySelectorAll('.sidenav');
    var instances = M.Sidenav.init(elems, options);
  });

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
profesor08, 2020-07-06
@profesor08

import "materialize.css/sass/components/forms/_checkboxes.scss";

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question