用户:Salt lovely/沙盒/投票箱/style.css

Salt lovely留言 | 贡献2024年3月23日 (六) 19:39的版本 (编辑“用户:Salt_lovely/沙盒/投票箱/style.css” // 维基盐编辑器)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。

  • Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5Ctrl-R(Mac为⌘-R
  • Google Chrome:Ctrl-Shift-R(Mac为⌘-Shift-R
  • Internet Explorer或Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5
  • Opera:Ctrl-F5
.salt-vote-container {
  width: 100%;
  max-width: 50rem;
  margin: 0 auto;
}
/* 标题栏 */
.salt-vote-container .salt-vote-title {
  width: 100%;
  font-size: 1.25rem;
  line-height: 2rem;
  text-align: center;
  color: #222d;
}
.salt-vote-container .salt-vote-subtitle {
  width: 100%;
  font-size: 1rem;
  line-height: 1.25rem;
  text-align: center;
  color: #333a;
}
/* 百分比条 */
.salt-vote-container .salt-vote-bar {
  display: flex;
  align-items: center;
  width: 100%;
  height: 1rem;
  margin: 0 0 0 1rem;
}
.salt-vote-container .salt-vote-bar .salt-vote-bar-item {
  position: relative;
  min-width: 2rem;
  height: 100%;
  line-height: 100%;
  text-align: center;
  transition: 240ms ease;
  text-shadow: 0 0 8px #fff;
}
.salt-vote-container .salt-vote-bar .salt-vote-bar-item:hover {
  text-shadow: 0 0 8px #fff, 0 0 8px #fff, 0 0 16px #fff, 0 0 16px #fff;
}
.salt-vote-container .salt-vote-bar .salt-vote-bar-item::before {
  content: "";
  position: absolute;
  top: 25%;
  bottom: 25%;
  left: 0;
  right: 0;
  background-color: var(--vote-color, #ab8749);
  opacity: 0.5;
  transition: 240ms ease;
  z-index: -1;
}
.salt-vote-container .salt-vote-bar .salt-vote-bar-item:hover::before {
  top: 0;
  bottom: 0;
  opacity: 1;
}
/* 不展示的部分 */
.salt-vote-container .salt-vote-color,
.salt-vote-container .salt-vote-describe {
  display: none;
}
/* 列表本身的样式 */
.salt-vote-container .salt-vote-options {
  display: flex;
  flex-wrap: wrap;
  margin: 0.5rem 0 0.5rem 1rem;
}
.salt-vote-container .salt-vote-options li {
  display: block;
  margin: 2px 0 0 0;
  border-left: 4px solid var(--vote-color, #ab8749);
}
.salt-vote-container .salt-vote-options li.has-desc {
  cursor: pointer;
}
.salt-vote-container .salt-vote-options li,
.salt-vote-container .salt-vote-options .salt-vote-option-content,
.salt-vote-container .salt-vote-options .salt-vote-desc {
  position: relative;
  width: 100%;
}
/* 列表本身的背景 */
.salt-vote-container .salt-vote-options li::before,
.salt-vote-container .salt-vote-options li .salt-vote-option-count,
.salt-vote-container .salt-vote-options li .salt-vote-option-count::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--vote-color, #ab8749);
  z-index: -1;
}
.salt-vote-container .salt-vote-options li::before {
  opacity: 0;
}
.salt-vote-container .salt-vote-options li:hover::before {
  opacity: 0.1;
}
.salt-vote-container .salt-vote-options li .salt-vote-option-count {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  padding-right: 0.5rem;
  background-color: transparent;
  pointer-events: none;
  opacity: 0.5;
}
.salt-vote-container .salt-vote-options li .salt-vote-option-count::before {
  width: var(--vote-percent, 0);
  left: auto;
  opacity: 0.2;
}
/* .salt-vote-container .salt-vote-options li:hover .salt-vote-option-count {
  opacity: 0.1;
} */
/* 选项主体部分 */
.salt-vote-container .salt-vote-options .salt-vote-option-content {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}
.salt-vote-container .salt-vote-options li .salt-vote-option {
  min-width: 4rem;
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  text-align: center;
  font-size: 1rem;
}
.salt-vote-container .salt-vote-options li .salt-vote-voter {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  padding: 0 1rem 0 0;
  font-size: 1rem;
}
.salt-vote-container .salt-vote-options li .salt-vote-voter a {
  display: block;
  position: relative;
  height: 1.5rem;
  padding: 0 0.4rem;
  margin: 0.1rem 0.2rem 0.1rem 0;
  line-height: 1.5rem;
  font-size: 0.9rem;
  box-sizing: border-box;
}
.salt-vote-container .salt-vote-options li .salt-vote-voter a::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--vote-color, #ab8749);
  opacity: 0.1;
  z-index: -1;
}
.salt-vote-container .salt-vote-options li .salt-vote-voter a:hover::before {
  opacity: 0.2;
}
/* 选项描述样式 */
.salt-vote-container .salt-vote-options .salt-vote-desc {
  height: 0;
  padding: 0.5rem 1rem;
  margin: -1rem 0 0 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  transition: all 0.2s ease;
  box-sizing: border-box;
}
.salt-vote-container .salt-vote-options .salt-vote-desc.show {
  height: var(--height, auto);
  max-height: 90wh;
  margin: 0 0 0 0;
  opacity: 1;
  pointer-events: auto;
}