Selectors inside mixin do not work

Đang mở
#133 6 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
42/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
css, javascript
Lĩnh vực
frontend, tooling

Hướng nghiên cứu

Reproduce the supplied mixin with postcss-mixins 8.1.0 and the listed PostCSS packages, comparing the output with version 6.2.3. Trace how selectors inside a mixin are expanded; done means the nested selectors produce working CSS rather than remaining inside .kanban-warning-icon.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Hi! I am updating postcss-mixins from 6.2.3 to 8.1.0, and noticed that if mixin has a selector inside it, it wont work anymore.

This:

@define-mixin svgicon-size-16 {
    height: 16px;
    width: 16px;
    stroke-width: .75px;

    .fill-notification-icon-line {
        stroke-width: 1.2px;
    }
    .stroke-notification-icon-line {
        stroke-width: 1px;
    }
}

.kanban-warning-icon {
    @mixin svgicon-size-16;
    flex: 0 0 16px;
    display: flex;
}

will become this:

.kanban-warning-icon {
    stroke-width: .75px;
    display: flex;
    flex: 0 0 16px;
    height: 16px;
    width: 16px;
    .fill-notification-icon-line {
        stroke-width: 1.2px
    }
    .stroke-notification-icon-line {
        stroke-width: 1px
    }
}

which obviously wont work.

Is this a bug or something wrong with my config?

These are postcss packages in use (before updating):

"postcss": "8.3.5",
"postcss-color-function": "4.1.0",
"postcss-flexbugs-fixes": "5.0.2",
"postcss-import": "14.0.2",
"postcss-mixins": "6.2.3",                // Updating to 8.1.0
"postcss-nested": "5.0.1",
"postcss-scss": "4.0.0",
"postcss-simple-vars": "6.0.2",
Ngôn ngữ chính
JavaScript
Star
486
Fork
49
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

  • Không có Dockerfile hay tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của postcss/postcss-mixins

Tất cả issue của postcss/postcss-mixins

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.