Skip to main content

A FastHTML plugin for using franken-ui easier

Project description

fh-frankenui

Wrapper for Franken UI to be used with fasthtml. This package is in development not ready for general use.

What is Franken UI?

At it's simplest, it is a helper to build HTML class strings used in the Franken UI library. This is done through:

  • Using enums to give autocomplete via python
    • style.Text.danger = 'uk-text-danger'
    • style.Background.primary = 'uk-background-primary'
    • style.Text.bold = 'uk-text-bold'
  • Ability to add to add classes together to build a new class string
    • s.Text.center + s.H.h2 + s.Background.primary = Str('uk-text-center uk-h2 uk-background-primary')
    • s.Text.center + s.H.h2 + s.Background.primary + 'your-own-class-string' = FrankenStr('uk-text-center uk-h2 uk-background-primary your-own-class-string')
  • Theme selection
    • s.Theme.blue.headers(): Gives CSS and JS headers for the blue theme

How do I use it?

# without wrapper
P(cls='uk-text-center uk-h2 uk-background-primary')("Your Title")

# with wrapper
P(cls=Text.center + H.h2 + Background.primary)("Your Title")
# without wrapper
P(cls='uk-text-center uk-h2 uk-background-primary my-own-class-string')("Your Title")

# with wrapper
P(cls=Text.center + H.h2 + Background.primary + 'my-own-class-string')("Your Title")
# without wrapper
app = FastHTML(hdrs = [Script(src="https://cdn.jsdelivr.net/npm/uikit@3.21.6/dist/js/uikit.min.js"),
                        Script(src="https://cdn.jsdelivr.net/npm/uikit@3.21.6/dist/js/uikit-icons.min.js"),
                        Link(rel="stylesheet", href="https://unpkg.com/franken-wc@0.0.6/dist/css/blue.min.css")])

# with wrapper
app = FastHTML(hdrs = Theme.blue.headers())

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

fh_frankenui-0.0.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

fh_frankenui-0.0.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file fh_frankenui-0.0.1.tar.gz.

File metadata

  • Download URL: fh_frankenui-0.0.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.1

File hashes

Hashes for fh_frankenui-0.0.1.tar.gz
Algorithm Hash digest
SHA256 3d2daca3e05e35e4f1ab59869f7b6f947af0d261695d5134b3b5c2905b89f47e
MD5 3754338b20955086ec59fd64f465a30b
BLAKE2b-256 b1fba8ab3b6ccfe9d23ee37f7548e887bc36e731378c0d7ee77c7cc250fa25f9

See more details on using hashes here.

File details

Details for the file fh_frankenui-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for fh_frankenui-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 625d6928842112f2b95d108b2d22034de7c8d71615318d42842d2299bfadfb87
MD5 950d6d1b5fc1363cb8ccd717d5d30ab3
BLAKE2b-256 d3e818c9947de3b0d8f736244a8f113a4005498565feba0400d931d171ceb339

See more details on using hashes here.

Supported by

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