Skip to content

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

Closed

Description

@loominade

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?

Activity

  1. ai commented on Jan 12, 2021

    @ai
    Member

    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.

  2. Dan503 commented on Jan 12, 2021

    @Dan503
    Contributor

    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.

  3. Dan503 commented on Jan 12, 2021

    @Dan503
    Contributor

    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.

  4. ai commented on Jan 12, 2021

    @ai
    Member

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

  5. Dan503 commented on Jan 12, 2021

    @Dan503
    Contributor

    Iike this?

    /* autoprefixer: ignore all warnings */
    

    And

    /* autoprefixer: ignore all warnings on the next line */
    
  6. ai commented on Jan 12, 2021

    @ai
    Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions