v1.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace zin;
  3. require_once dirname(__DIR__) . DS . 'checkbtngroup' . DS . 'v1.php';
  4. class checkColorGroup extends checkBtnGroup
  5. {
  6. public static function getPageCSS()
  7. {
  8. return <<<CSS
  9. .check-btn-group {gap: 1px; padding: 0; border-radius: var(--radius); margin-top: 4px;}
  10. .check-btn-group > .check-btn {flex: auto; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;}
  11. .check-btn-group > .check-btn > label {width: 20px; height: 20px; padding: 0; margin-right: 6px; --tw-ring-color: transparent; border-radius: var(--radius-full);}
  12. .check-btn-group > .check-btn > input:checked + label {font-family: ZentaoIcon; text-align: center; color: #fff;}
  13. .check-btn-group > .check-btn > input:checked + label.btn::after {font-size: 14px; content: '\\e5ca';}
  14. .check-btn-group > .check-btn > label > svg {display: none}
  15. CSS;
  16. }
  17. /**
  18. * @param mixed[] $props
  19. */
  20. public function buildItem($props)
  21. {
  22. $props['text'] = '';
  23. $props['labelStyle'] = array('background-color' => $props['value']);
  24. return parent::buildItem($props);
  25. }
  26. protected function build()
  27. {
  28. return parent::build();
  29. }
  30. }