Composes should cascade within a block

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

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
scss, typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Bắt đầu với hai tệp ví dụ, tag.block.scss và text-body.block.scss, rồi theo dõi cách CSS Blocks giải quyết nhiều khai báo composes trong cùng một block. Tái hiện ví dụ và kiểm tra đầu ra style đã được giải quyết. Hoàn thành khi tag được bật giải quyết màu văn bản từ composition sau đó, đồng thời giữ nguyên các style được compose và style cục bộ khác.

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

Mô tả

@css-blocks/core

If we have two classes on the same block that are composing other classes, it should just work. In the code block below, the resolved style should be that of text-body[color=text].

tag.block.scss

:scope {
  composes: 'text-body[color=text-on-dark]', 'text-body[size=small]';
  border-radius: token('corner-radius-small');
  padding: token('spacing-half-x') token('spacing-one-x');
}

// types
:scope[type=enabled] {
  composes: 'text-body[color=text]';
  background-color: token('color-background-none-active');
}

text-body.block.scss

/ defaults
:scope {
  font-size: token('font-size-medium');
  line-height: token('line-height-default');
  font-weight: token('font-weight-regular');
  color: token('color-text');
}

:scope[size=small] {
  font-size: token('font-size-small');
}

:scope {
  @include text-color('text');
  @include text-color('text-low-emphasis');
  @include text-color('action');
  @include text-color('signal-positive');
  @include text-color('signal-negative');
  @include text-color('signal-neutral');
  @include text-color('text-on-dark');
}
Ngôn ngữ chính
TypeScript
Star
6.3k
Fork
154
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

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 linkedin/css-blocks

Tất cả issue của linkedin/css-blocks

Issue tương tự

Thêm issue về TypeScript

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.