Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

useCss !important not possible

Đang mở
#2,644 2 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
css, react, typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Start by locating the useCss hook and reproduce the reported example with color: 'red !important' alongside padding: 5. Confirm that the generated CSS includes both declarations, with the color value retaining !important, and verify that ordinary declarations still render correctly.

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

Mô tả

What is the current behavior?
Properties with !important will not be rendered in the generated css class, not even without the !important-flag.

The following Example:

const myComponent = ()=> {
  const styleClass = useCss({
    color: 'red !important',
    padding:5,
  })

  return <div class={styleClass}>TEST</div>
}

RENDERS:

<style>
.react-use-css-1x {
  padding:5px;
}
</style>

<div class="react-use-css-1x">TEST</TEST>

The color-Property is completely ignored and not part of the rendered css, not even without the !important.
Without the !important all functions well.

The expected Result is:

<style>
.react-use-css-1x {
  color: red !important;
  padding:5px;
}
</style>

<div class="react-use-css-1x">TEST</TEST>

A little about versions:

  • OS:
  • Browser (vendor and version):
  • React: 18.2.0
  • react-use: 17.6.0
  • Did this worked in the previous package version? NO
Ngôn ngữ chính
TypeScript
Star
44k
Fork
3.3k
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 streamich/react-use

Tất cả issue của streamich/react-use

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.