Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3000+ 分值题目样式丢失 #47

Closed
huxulm opened this issue Mar 5, 2025 · 3 comments
Closed

3000+ 分值题目样式丢失 #47

huxulm opened this issue Mar 5, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@huxulm
Copy link
Owner

huxulm commented Mar 5, 2025

可能由于迭代时没有注意导致。
原先:

现在:

Image @Autumnal-Joy

@huxulm huxulm added the enhancement New feature or request label Mar 5, 2025
@Autumnal-Joy
Copy link
Collaborator

ok,我目前正在搞进度选项的问题,这个之后我看看

@Autumnal-Joy Autumnal-Joy self-assigned this Mar 5, 2025
@Autumnal-Joy
Copy link
Collaborator

3000以上的题对应下标 idx=7 (这里的颜色c似乎定义了没用到)

// components/RatingCircle/index.tsx
export const COLORS = [
  { l: 0, r: 1200, c: "#ffffff" },
  { l: 1200, r: 1400, c: `#828282` },
  { l: 1400, r: 1600, c: `#4BA59E` },
  { l: 1600, r: 1900, c: `#1B01F5` },
  { l: 1900, r: 2100, c: `#9B1EA4` },
  { l: 2100, r: 2400, c: `#F09235` },
  { l: 2400, r: 3000, c: `#EA3323` },
  { l: 3000, r: 4000, c: `#EA3323` },
];

样式表里把idx=7设置为透明,所以边框变成透明了

// _common.scss
[data-bs-theme] {
  --rating-color-0: #848484;
  --rating-color-1: #595959;
  --rating-color-2: #4BA59E;
  --rating-color-3: #1B01F5;
  --rating-color-4: #9B1EA4;
  --rating-color-5: #F09235;
  --rating-color-6: #EA3323;
  --rating-color-7: transparent;
}
[data-bs-theme=dark] {
  color-scheme: dark;
  --rating-color-0: #c5c4c4;
  --rating-color-1: #ffffff;
  --rating-color-2: #74fff3;
  --rating-color-3: #6857ff;
  --rating-color-4: #ec60f6;
  --rating-color-5: #f8a95b;
  --rating-color-6: #f35041;
  --rating-color-7: transparent;
}

之前没出现问题是因为,添加了自定义属性 data="top"

// _common.scss
.inner-circle[data="top"] {
  border-color: var(--rating-color-6)!important;
}

字段命名不符合html规范,eslint报错,当时没注意到这个样式,被我当作bug修掉了 #43 (comment)

@Autumnal-Joy Autumnal-Joy added bug Something isn't working and removed enhancement New feature or request labels Mar 5, 2025
@huxulm
Copy link
Owner Author

huxulm commented Mar 5, 2025

已恢复👍🎉🎈

@huxulm huxulm closed this as completed Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants