ui.Checkbox.style

विजेट की स्टाइल ActiveDictionary दिखाता है. विजेट की स्टाइल अपडेट करने के लिए, इसमें बदलाव किया जा सकता है.

ऐसी प्रॉपर्टी जो सीएसएस प्रॉपर्टी की तरह काम करती हैं:

  - height, maxHeight, minHeight (उदाहरण के लिए, '100px')

  - width, maxWidth, minWidth (उदाहरण के लिए, '100px')

  - पैडिंग, मार्जिन (उदाहरण के लिए, '4px 4px 4px 4px' या सिर्फ़ '4px')

  - color, backgroundColor (जैसे, 'red' या '#FF0000')

  - बॉर्डर (उदाहरण के लिए, '1px solid black')

  - borderColor (उदाहरण के लिए, 'red black blue #FF0000')

  - borderRadius (उदाहरण के लिए, '10px')

  - borderStyle (उदाहरण के लिए, 'solid dashed none dotted')

  - borderWidth (उदाहरण के लिए, '1px 0px 1px 0px')

  - fontSize (उदाहरण के लिए, '24px')

  - फ़ॉन्ट स्टाइल (उदाहरण के लिए, 'इटैलिक')

  - fontWeight (उदाहरण के लिए, 'bold' या '100')

  - fontFamily (उदाहरण के लिए, 'monospace' या 'serif')

  - textAlign (जैसे, 'left' या 'center')

  - textDecoration (उदाहरण के लिए, 'underline' या 'line-through')

  - whiteSpace (उदाहरण के लिए, 'nowrap' या 'pre')

  - दिखाया गया (सही या गलत)

साथ काम करने वाली कस्टम लेआउट प्रॉपर्टी (ui.Panel.Layout दस्तावेज़ देखें):

  - स्ट्रेच ('हॉरिज़ॉन्टल', 'वर्टिकल', 'दोनों')

  - पोज़िशन ('top-right', 'top-center', 'top-left', 'bottom-right', ...)

इस्तेमालरिटर्न
Checkbox.style()ui.data.ActiveDictionary
आर्ग्यूमेंटटाइपविवरण
यह: ui.widgetui.Widgetui.Widget इंस्टेंस.

उदाहरण

कोड एडिटर (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);