CSS の対応するプロパティと同様の動作をするプロパティ:
- height、maxHeight、minHeight(例: '100px')
- width、maxWidth、minWidth(例: '100px')
- padding、margin(例: '4px 4px 4px 4px' または '4px')
- color、backgroundColor(例: 'red'、'#FF0000')
- border(例: '1px solid black')
- borderColor(例: 'red black blue #FF0000')
- borderRadius(例: '10px')
- borderStyle(例: 'solid dashed none dotted')
- borderWidth(例: '1px 0px 1px 0px')
- fontSize(例: '24px')
- fontStyle(例: 'italic')
- fontWeight(例: 'bold'、'100')
- fontFamily(例: monospace、serif)
- textAlign(例: 'left' または 'center')
- textDecoration(例: 'underline'、'line-through')
- whiteSpace(例: 'nowrap'、'pre')
- shown(true または false)
サポートされているカスタム レイアウト プロパティ(ui.Panel.Layout のドキュメントを参照):
- stretch('horizontal'、'vertical'、'both')
- position('top-right'、'top-center'、'top-left'、'bottom-right' など)
用途 | 戻り値 |
---|---|
Slider.style() | ui.data.ActiveDictionary |
引数 | タイプ | 詳細 |
---|---|---|
これ: ui.widget | ui.Widget | ui.Widget インスタンス。 |
例
コードエディタ(JavaScript)
// Define a UI widget and add it to the map. var widget = ui.Slider({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('backgroundColor', 'E0E0E0'); 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);