ui.Checkbox.style

Retorna o ActiveDictionary de estilo do widget, que pode ser modificado para atualizar os estilos do widget.

Propriedades que se comportam como as contrapartes do CSS:

  - height, maxHeight, minHeight (por exemplo, '100px')

  - width, maxWidth, minWidth (por exemplo, '100px')

  - padding, margin (por exemplo, '4px 4px 4px 4px' ou simplesmente '4px')

  - color, backgroundColor (por exemplo, "red" ou "#FF0000")

  - border (por exemplo, "1px solid black")

  - borderColor (por exemplo, "vermelho preto azul #FF0000")

  - borderRadius (por exemplo, '10px')

  - borderStyle (por exemplo, 'solid dashed none dotted')

  - borderWidth (por exemplo, '1px 0px 1px 0px')

  - fontSize (por exemplo, '24px')

  - fontStyle (por exemplo, 'italic')

  - fontWeight (por exemplo, 'bold' ou '100')

  - fontFamily (por exemplo, "monospace" ou "serif")

  - textAlign (por exemplo, "left" ou "center")

  - textDecoration (por exemplo, "underline" ou "line-through")

  - whiteSpace (por exemplo, "nowrap" ou "pre")

  - mostrado (verdadeiro ou falso)

Propriedades de layout personalizado com suporte (consulte a documentação de ui.Panel.Layout):

  - alongamento ("horizontal", "vertical", "ambos")

  - posição ("top-right", "top-center", "top-left", "bottom-right", ...)

UsoRetorna
Checkbox.style()ui.data.ActiveDictionary
ArgumentoTipoDetalhes
ui.widgetui.WidgetA instância ui.Widget.

Exemplos

Editor de código (JavaScript)

// Define a UI widget and add it to the map.
var widget = ui.Checkbox({label: 'A ui.Checkbox', style: {width: '400px'}});
Map.add(widget);

// View the UI widget's style properties; an ActiveDictionary.
print(widget.style());

// ActiveDictionaries are mutable; set a style property.
widget.style().set('color', 'blue');
print(widget.style());

// Define the UI widget's style ActiveDictionary as a variable.
var widgetStyle = widget.style();
print(widgetStyle);

// Set the UI widget's style properties from the ActiveDictionary variable.
widgetStyle.set({border: '5px solid darkgray'});
print(widgetStyle);