الخصائص التي تتصرف مثل نظيراتها في CSS:
- height وmaxHeight وminHeight (مثلاً '100px')
- width وmaxWidth وminWidth (مثلاً '100px')
- padding, margin (e.g. '4px 4px 4px 4px' or simply '4px')
- color, backgroundColor (مثلاً 'red' أو #FF0000)
- border (e.g. '1px solid black')
- borderColor (مثلاً 'red black blue #FF0000')
- borderRadius (مثلاً '10px')
- borderStyle (مثلاً، "solid dashed none dotted")
- borderWidth (مثلاً '1px 0px 1px 0px')
- fontSize (مثلاً '24px')
- fontStyle (مثل "مائل")
- fontWeight (مثل "bold" أو "100")
- fontFamily (مثلاً 'monospace' أو 'serif')
- textAlign (مثل "left" أو "center")
- textDecoration (مثل 'underline' أو 'line-through')
- whiteSpace (مثلاً nowrap أو pre)
- shown (صحيح أو خطأ)
خصائص التنسيق المخصّص المتوافقة (راجِع مستندات ui.Panel.Layout):
- stretch ('horizontal', 'vertical', 'both')
- الموضع (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);