Explorar o código

adding colors documentation

Rodja Trappe %!s(int64=3) %!d(string=hai) anos
pai
achega
b8cdad425c
Modificáronse 2 ficheiros con 10 adicións e 1 borrados
  1. 6 1
      main.py
  2. 4 0
      nicegui/elements/colors.py

+ 6 - 1
main.py

@@ -281,7 +281,7 @@ with example(ui.notify):
 
 design = '''### Styling
 
-NiceGUI uses the [Quasar Framework](https://quasar.dev/) and hence has its full design power.
+NiceGUI uses the [Quasar Framework](https://quasar.dev/) version 1.0 and hence has its full design power.
 Each NiceGUI element provides a `props` method whose content is passed [to the Quasar component](https://justpy.io/quasar_tutorial/introduction/#props-of-quasar-components):
 Have a look at [the Quasar documentation](https://quasar.dev/vue-components/button#design) for all styling props.
 You can also apply [Tailwind](https://tailwindcss.com/) utility classes with the `classes` method.
@@ -294,6 +294,11 @@ with example(design):
     ui.radio(['x', 'y', 'z'], value='x').props('inline color=green')
     ui.button().props('icon=touch_app outline round').classes('shadow-lg ml-14')
 
+with example(ui.colors):
+    ui.button('Gray', on_click=lambda: ui.colors(primary='#555'))
+    ui.button('Default', on_click=lambda: ui.colors())
+    ui.colors()
+
 with example(ui.card):
     with ui.card().tight():
         ui.image('http://placeimg.com/640/360/nature')

+ 4 - 0
nicegui/elements/colors.py

@@ -24,4 +24,8 @@ class Colors(Element):
                  negative='#c10015',
                  info='#31ccec',
                  warning='#f2c037'):
+        """Color Theming
+
+        Sets the main colors (primary, secondary, accent, ...) used by [Quasar](https://quasar.dev/).
+        """
         super().__init__(ColorsView(primary, secondary, accent, positive, negative, info, warning))