fun getRadioButtonCSS()

in intellij-plugin/educational-core/src/com/jetbrains/edu/learning/taskToolWindow/ui/jcefUtils.kt [123:187]


fun getRadioButtonCSS(): String {
  val styleManager = StyleManager()
  return CssBuilder().apply {
    ".checkbox, .radio" {
      marginTop = 2.px
      marginRight = 9.px
      verticalAlign = VerticalAlign("middle")
      position = Position.relative
      backgroundColor = getRadioButtonBackgroundColor()
      borderWidth = 0.7.px
      borderColor = getBorderColor()
      borderStyle = BorderStyle.solid
      outline = Outline.none
    }
    ".checkbox" {
      borderRadius = 3.px
      //sets size of the element
      padding = Padding(8.px)
    }
    ".radio" {
      borderRadius = 50.pct
      width = 16.px
      height = 16.px
    }
    ".radio:checked" {
      padding = Padding(3.2.px)
      color = styleManager.bodyColor
      backgroundColor = getRadioButtonCheckedBackgroundColor()
      borderColor = getRadioButtonCheckedBorderColor()
      borderWidth = (5.9).px
    }
    ".checkbox:checked" {
      backgroundColor = getRadioButtonCheckedBorderColor()
      borderColor = getRadioButtonCheckedBorderColor()
    }
    ".checkbox:checked:after" {
      display = Display.block
    }
    ".checkbox:after" {
      display = Display.none
      position = Position.absolute
      content = QuotedString("")
      left = 6.px
      top = 2.px
      width = 3.px
      height = 8.px
      backgroundColor = getRadioButtonCheckedBorderColor()
      borderStyle = BorderStyle.solid
      borderColor = getRadioButtonCheckedBackgroundColor()
      borderTopWidth = 0.px
      borderBottomWidth = 2.px
      borderLeftWidth = 0.px
      borderRightWidth = 2.px
      transform.rotate(35.deg)
    }
    ".radio:focus, .radio:before, .radio:hover, .checkbox:focus, .checkbox:before, .checkbox:hover" {
      boxShadow += BoxShadow(color = getRadioButtonFocusColor(), 0.px, 0.px, 2.px, 2.px)
    }
    ".disable:focus, .disable:before, .disable:hover" {
      boxShadow = BoxShadows.none
    }
  }.toString()
    .plus(".checkbox, .radio { -webkit-appearance: none; }")
    .plus(getRadioButtonSystemSpecificCss())
}