Sfoglia il codice sorgente

move style definition for ui.link into nicegui.css

Falko Schindler 2 anni fa
parent
commit
27a6b42bac
2 ha cambiato i file con 10 aggiunte e 1 eliminazioni
  1. 1 1
      nicegui/elements/link.py
  2. 9 0
      nicegui/static/nicegui.css

+ 1 - 1
nicegui/elements/link.py

@@ -22,7 +22,7 @@ class Link(TextElement):
         super().__init__(tag='a', text=text)
         self._props['href'] = target if isinstance(target, str) else globals.page_routes[target]
         self._props['target'] = '_blank' if new_tab else '_self'
-        self._classes.extend(['underline', 'text-blue-500'])
+        self._classes = ['nicegui-link']
 
 
 class LinkTarget(Element):

+ 9 - 0
nicegui/static/nicegui.css

@@ -39,6 +39,15 @@
   gap: 1rem;
   padding: 16px;
 }
+.nicegui-link:link,
+.nicegui-link:visited {
+  text-decoration-line: underline;
+  color: rgb(59 130 246);
+}
+.nicegui-link:hover,
+.nicegui-link:active {
+  opacity: 0.8;
+}
 .nicegui-separator {
   width: 100%;
 }