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

Can not find grid areas: intentional-left-blank #1386

Open
loominade opened this issue Jan 12, 2021 · 6 comments
Open

Can not find grid areas: intentional-left-blank #1386

loominade opened this issue Jan 12, 2021 · 6 comments

Comments

@loominade
Copy link

lets say I have a grid layout, where I want to draw ab H where certain regions are intentionally left blank:

.grid {
  grid-gap: 1px;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  grid-template-areas: 'left top-void    right'
                       'left center      right'
                       'left bottom-void right' 
}

.grid__left {
  grid-area: left;
}

.grid__center {
  grid-area: center;
}

.grid__right {
  grid-area: right;
}

The build would produce the following warning

Can not find grid areas: top-void, bottom-void

But having empty grid areas is perfectly valid, isn't it? What should I do to solve this warning?

@ai
Copy link
Member

ai commented Jan 12, 2021

Non-used areas may be caused by mistake. It is better to explicitly mark them as empty.

We can add an option to hide this warning. Send PR.

@Dan503
Copy link
Contributor

Dan503 commented Jan 12, 2021

But having empty grid areas is perfectly valid, isn't it?

You are right, it is perfectly valid.

What should I do to solve this warning?

I ran into this once in one of my own projects. I ended up working around the issue by just adding an empty <div> to the page for each area I wanted to leave blank and assigned those divs to the empty areas. Not ideal but it worked.

We can add an option to hide this warning.

I think it would make more sense to have some sort of generic control comment for ignoring warnings.

That allows the warning to still take effect when it is a mistake but allows an explicit ignoring of the warning when it is intentional.

There are feasibily more instances where autoprefixer produces false positive warnings for other reasons. Having a control comment for ignoring warnings would solve more than just this issue.

@Dan503
Copy link
Contributor

Dan503 commented Jan 12, 2021

I propose these two control comments

/* autoprefixer: warnings off */

Works the same way as /* autoprefixer: off */ except it just ignores all warnings instead of turning autoprefixer off completely.

/* autoprefixer: ignore next warning */

Ignores warnings that were generated by the next line of css that immediately follow this control comment.

@ai
Copy link
Member

ai commented Jan 12, 2021

/* autoprefixer: ignore next warning */ let’s use more words to avoid over-using.

@Dan503
Copy link
Contributor

Dan503 commented Jan 12, 2021

Iike this?

/* autoprefixer: ignore all warnings */

And

/* autoprefixer: ignore all warnings on the next line */

@ai
Copy link
Member

ai commented Jan 12, 2021

/* autoprefixer: ignore next warning */ is enouph :)

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

3 participants