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

Ignore option is not working. #419

Open
tonilopezmr opened this issue Oct 20, 2019 · 1 comment
Open

Ignore option is not working. #419

tonilopezmr opened this issue Oct 20, 2019 · 1 comment
Projects

Comments

@tonilopezmr
Copy link

I'm using Bulma and I'm trying to ignore .navbar-burger.is-active because it's a class you set on runtime, in bulma, is-active its used a lot in different components.

I'm using this configuration:

options = {
    banner: false,
    csspath: "",
    htmlroot: "./src/",
    ignore: [
         "/\\..+\\.is-active\\.+/", 
        ".navbar-burger.is-active", 
        ".navbar-menu.is-active"
     ], //Added at runtime
    jsdom: {
      userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X)"
    },
    report: true,
    stylesheets: ["style.css"],
    timeout: 1000,
    userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X)"
  };

calling to:

uncss(files, options, function(error, output) { ... }

Here are the elements I want to keep on the CSS output.

.navbar-burger:hover {
    background-color: rgba(0, 0, 0, .05)
}

.navbar-burger.is-active span:nth-child(1) {
    -webkit-transform: translateY(5px) rotate(45deg);
    transform: translateY(5px) rotate(45deg)
}

.navbar-burger.is-active span:nth-child(2) {
    opacity: 0
}

.navbar-burger.is-active span:nth-child(3) {
    -webkit-transform: translateY(-5px) rotate(-45deg);
    transform: translateY(-5px) rotate(-45deg)
}

Also, I have tried the ignore selector on the CSS but is not working, ISSUE #410. It seems it's partially working because for .navbar-menu.is-active it's working fine but none for navbar-burger don't know why

@jr-gitgo
Copy link

jr-gitgo commented Oct 30, 2019

Had the same problem with the regex ignores - remove quotes for the regex and it should work.

ignore: [ /\\..+\\.is-active\\.+/, ... ], /

@giakki giakki added this to To do in To-do board via automation Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
To-do board
  
To do
Development

No branches or pull requests

2 participants