Skip to main content

A modern, Tailwind CSS-based UI library for air development

Project description

EidosUI 🎨

A modern, flexible Tailwind CSS-based UI library for Python web frameworks. Built for maximum developer flexibility while providing excellent defaults.

[!CAUTION] This library is not ready for anything yet. IN fact, this readme is more of design ideas than anything as much of what's in here isn't implemented yet!

Design

Base CSS

  • styles.css : defines all the core css logic to create classes like edios-mark, eidos-small, etc.
  • light.css/dark.css : These define lots of css variables used in styles.css and are themes

Users would create a custom theme by copying light/dark css files and changing the variable definitions.

Styles

This has enums that make the Base CSS clases accessible in python. For example:

styles.typography.h1 or styles.buttons.primary

Tags

def H1(*content, cls: str = None, **kwargs) -> air.H1:
    """Semantic H1 heading"""
    return air.H1(*content, cls=stringify(styles.typography.h1, cls), **kwargs)

def Mark(*content, cls: str = None, **kwargs) -> air.Mark:
    """Highlighted text"""
    return .Mark(*content, cls=stringify(styles.typography.mark, cls), **kwargs)

def Small(*content, cls: str = , **kwargs) -> air.Small:
    """Small text"""
    return air.Small(*content, cls=stringify(styles.typography.small, cls), **kwargs) 

Components (Not Built Yet)

Theses are things that go beyond just exposing css to python. Here's a simple example of what might be added.

class Table:
    def __init__(self, cls: str = None, **kwargs):
        """Create an empty table with optional styling"""
        self.cls = cls
        self.kwargs = kwargs
    
    @classmethod
    def from_lists(cls, data: list[list], headers: list[str] = None, cls_: str = None, **kwargs):
        """Create table from list of lists"""
        thead = []
        if headers:
            thead = THead(Tr(*[Th(header) for header in headers]))
        
        tbody_rows = []
        for data in row_data:
            tbody_rows.append(Tr(*map(Td, row_data)))
        tbody = TBody(*tbody_rows)
        
        return Table(thead+tbody, cls=cls_, **kwargs)
    
    @classmethod
    def from_dicts(cls, data: list[dict], headers: list[str] = None, cls_: str = None, **kwargs):
        """Create table from list of dictionaries"""
        thead = []
        if headers:
            thead = THead(Tr(*[Th(header) for header in headers]))
        
        tbody_rows = []
        for row in data:
            tbody_rows.append(Tr(*[Td(row.get(header, "")) for header in (headers or list(row.keys()))]))
        tbody = TBody(*tbody_rows)
        
        return Table(thead+tbody, cls=cls_, **kwargs)

# Usage examples:
Table.from_lists([["A", "B"], ["C", "D"]], headers=["Col1", "Col2"])
Table.from_dicts([{"name": "John", "age": 25}], headers=["Name", "Age"])

Plugins

edios-md

This will be installable with pip install "eidos[markdown]".

This is a plugin for rendering markdown that is well scoped to just markdown rendering. This module does markdown rendering well with table of contents with scrollspy, code highlighting, latex rendering, etc. It must be used with EidosUI as it uses css variables from there for the styling (so it is always in sync with the theme)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eidosui-0.3.0.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eidosui-0.3.0-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

Details for the file eidosui-0.3.0.tar.gz.

File metadata

  • Download URL: eidosui-0.3.0.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for eidosui-0.3.0.tar.gz
Algorithm Hash digest
SHA256 1a25afc4db83248c06a9bc31d1e9a52c938d960e5538bcb4f056cf1a073172cd
MD5 f9afd2aa74c9640f01d9a51bae7a5a96
BLAKE2b-256 624f4ef2f30b5df328c6176eb166b0ba7e5a9cb41c6462fbf8f7f302ce8fdd61

See more details on using hashes here.

File details

Details for the file eidosui-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: eidosui-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 21.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for eidosui-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e5962a929fa364ecdea1a91a7a51942629c38492742d531d504007b5ce1d460b
MD5 80ad87e6c59324fe6f81a01134e08b30
BLAKE2b-256 a00bdc1c2aadd35fbf85f45b94817c998b2d8cbb67063e6b3298e5fb9ad0258e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page