question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option Request: space-between-nested-blocks

See original GitHub issue

I would like to suggest an option, space-between-nested-blocks. For my needs, I’d just like to make sure there is a line between my current rules and a nested selector. Example:

Example Source

.foo {
  color: black;
  .bar {
    color: gray;
  }
}

space-between-nested-blocks = true

.foo {
  color: black;

  .bar {
    color: gray;
  }
}

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:5
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
hudochenkovcommented, Jun 21, 2015

I want to visual separate block’s properties, includes, extends and it’s children. As I understand, now block’s children not participating in sort-order. So it glued with no empty lines with all sort-order effected nodes. If we can identify all block’s children as one entity, we can put them in sort-order. Previous implementation of $include works similar way: it gather all @include and @​extend in order presented in source file.

Example config:

{ "sort-order": [

["position", "top", "left", "margin", "padding", "padding-right", "content"],
["$include desk", "$include palm"],
["$nested-blocks"]

]}

Before:

.panel {
    position: absolute;
    top: 0;
    left: 0;
    &__inner {
        padding: 0 8px 0 20px;
        &:before {
            content: "";
        }
    }
    &__close {
        display: block;
    }
}

After (added two empty lines):

.panel {
    position: absolute;
    top: 0;
    left: 0;

    &__inner {
        padding: 0 8px 0 20px;

        &:before {
            content: "";
        }
    }
    &__close {
        display: block;
    }
}

Before:

.panel {
    position: absolute;
    top: 0;
    left: 0;

    @include palm {
        position: relative;
    }

    &__inner {
        padding: 0 8px 0 20px;

        @include desk {
            margin: 0 3.5%;
        }
        @include palm {
            padding-right: 20px;
        }
    }
    &__close {
        display: block;
    }
}

After (added one empty line):

.panel {
    position: absolute;
    top: 0;
    left: 0;

    @include palm {
        position: relative;
    }

    &__inner {
        padding: 0 8px 0 20px;

        @include desk {
            margin: 0 3.5%;
        }
        @include palm {
            padding-right: 20px;
        }
    }
    &__close {
        display: block;
    }
}
1reaction
BorodinDKcommented, May 6, 2016

+1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reference: Layout blocks - Slack API
A comprehensive breakdown of blocks used to lay out app surfaces. ... Use it to delineate between different groups of content in your...
Read more >
Using The New Constrained Layout In WordPress Block Themes
We just covered the new spacing and alignments we get with WordPress 6.1. Those are specific to blocks and any nested blocks within...
Read more >
Block Spacing | Learn WordPress
It allows you to add or remove space between nested blocks. Block spacing is one of the controls you will find under the...
Read more >
New inline CSS rules for nested blocks difficult to override
Use a nested block with the option “inherit default layout” activated. Try to set a custom max-width on a child element with alignwide ......
Read more >
Edit the space between items (paddings) in auto layout ...
In this case, the only option is to create another nested frame and another auto layout. This can result in many nested auto...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found