ui.Checkbox.style

Muestra el ActiveDictionary de estilo del widget, que se puede modificar para actualizar los estilos del widget.

Propiedades que se comportan como sus contrapartes de CSS:

  - height, maxHeight, minHeight (p.ej., '100px')

  - width, maxWidth, minWidth (p.ej., "100px")

  - padding, margin (p.ej., "4px 4px 4px 4px" o simplemente "4px")

  - color, backgroundColor (p.ej., "red" o "#FF0000")

  - Borde (p.ej., "1px solid black")

  - borderColor (p.ej., "red black blue #FF0000")

  - borderRadius (p.ej., "10px")

  - borderStyle (p.ej., "solid dashed none dotted")

  - borderWidth (p.ej., "1px 0px 1px 0px")

  - fontSize (p.ej., "24px")

  - fontStyle (p.ej., “italic”)

  - fontWeight (p.ej., “bold” o “100”)

  - fontFamily (p.ej., "monospace" o "serif")

  - textAlign (p.ej., “left” o “center”)

  - textDecoration (p.ej., "underline" o "line-through")

  - whiteSpace (p.ej., "nowrap" o "pre")

  - shown (verdadero o falso)

Propiedades de diseño personalizadas admitidas (consulta la documentación de ui.Panel.Layout):

  - stretch ('horizontal', 'vertical', 'both')

  - position ("top-right", "top-center", "top-left", "bottom-right", …)

UsoMuestra
Checkbox.style()ui.data.ActiveDictionary
ArgumentoTipoDetalles
esto: ui.widgetui.WidgetLa instancia de ui.Widget.

Ejemplos

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);