Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Bug with extending some selector contain nested selector #29

@item4

Description

@item4

I tried some test.

Conditions

  1. requirements (git submodule) for external scss framework

    git submodule add --name bootstrap-sass git@github.com:twbs/bootstrap-sass.git
  2. test.scss

    @import "bootstrap-sass/assets/stylesheets/bootstrap";
    
    .test {
      @extend .table;
    }

Tests

libsass-python's sassc command

Output (I added some new line to pretty view)

.table > thead > tr > th, 
  .table > thead > tr > .test, 
  .table > thead > tr > td, 
  .table > thead > tr > .test, 
  .table > tbody > tr > th, 
  .table > tbody > tr > .test, 
  .table > tbody > tr > td, 
  .table > tbody > tr > .test, 
  .table > tfoot > tr > th, 
  .table > tfoot > tr > .test, 
  .table > tfoot > tr > td, 
  .table > tfoot > tr > .test {
    padding: 8px;
    line-height: 1.42857;
    vertical-align: top;
    border-top: 1px solid #ddd; }

Result: wrong

ruby sass command

Output

.table > thead > tr > th, .test > thead > tr > th,
  .table > thead > tr > td,
  .test > thead > tr > td,
  .table > tbody > tr > th,
  .test > tbody > tr > th,
  .table > tbody > tr > td,
  .test > tbody > tr > td,
  .table > tfoot > tr > th,
  .test > tfoot > tr > th,
  .table > tfoot > tr > td,
  .test > tfoot > tr > td {
    padding: 8px;
    line-height: 1.42857;
    vertical-align: top;
    border-top: 1px solid #ddd; }

Result: correct

sassc (libsass CLI implementation)

Output

.table > thead > tr > th, 
  .test > thead > tr > th, 
  .table > thead > tr > td, 
  .test > thead > tr > td, 
  .table > tbody > tr > th, 
  .test > tbody > tr > th, 
  .table > tbody > tr > td, 
  .test > tbody > tr > td, 
  .table > tfoot > tr > th, 
  .test > tfoot > tr > th, 
  .table > tfoot > tr > td, 
  .test > tfoot > tr > td {
    padding: 8px;
    line-height: 1.42857;
    vertical-align: top;
    border-top: 1px solid #ddd; }

Result: correct

sassc v1.0.1 with libsass v2.0.0

Output

.table > thead > tr > th, 
  .table > thead > tr > .test, 
  .table > thead > tr > td, 
  .table > thead > tr > .test, 
  .table > tbody > tr > th, 
  .table > tbody > tr > .test, 
  .table > tbody > tr > td, 
  .table > tbody > tr > .test, 
  .table > tfoot > tr > th, 
  .table > tfoot > tr > .test, 
  .table > tfoot > tr > td, 
  .table > tfoot > tr > .test {
    padding: 8px;
    line-height: 1.42857;
    vertical-align: top;
    border-top: 1px solid #ddd; }

Result: wrong


I (also) think it is libsass 2.0's problem. if someone faced problems like this, he must wait for supporting next libsass version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions