浏览代码

using new styling methods in demo

Rodja Trappe 4 年之前
父节点
当前提交
b0e2befe5d
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 2 2
      main.py
  2. 2 2
      nicegui/elements/icon.py

+ 2 - 2
main.py

@@ -37,9 +37,9 @@ with ui.row():
                 clock = ui.label()
                 ui.timer(0.1, lambda: clock.set_text(datetime.now().strftime("%X")))
 
-        with ui.card():
+        with ui.card().add_classes('items-center'):
             ui.label('Style', 'h5')
-            ui.icon('fas fa-umbrella-beach', size='88px', color='amber-14')
+            ui.icon('fas fa-umbrella-beach', size='70px').add_classes('text-amber-14').add_style('margin: 9px')
             ui.link('color palette', 'https://quasar.dev/style/color-palette')
 
     with ui.card():

+ 2 - 2
nicegui/elements/icon.py

@@ -3,8 +3,8 @@ from .element import Element
 
 class Icon(Element):
 
-    def __init__(self, name: str, size: str = '20px', color: str = 'dark'):
+    def __init__(self, name: str, size: str = '20px'):
 
-        view = jp.QIcon(name=name, classes=f'q-pt-xs text-{color}', size=size)
+        view = jp.QIcon(name=name, classes=f'q-pt-xs', size=size)
 
         super().__init__(view)