-
-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
apiThis has to do with the Python API (view)This has to do with the Python API (view)complexThis should only be looked at by someone who knows what they're doingThis should only be looked at by someone who knows what they're doingdelayedDelayed due to another issueDelayed due to another issueimprovementImprovement to an existing featureImprovement to an existing feature
Milestone
Description
Improvement Description
Styling right now consists of manually writing style() tags or loading CSS files. I think there could be a better way that this is done. I have a number of ideas on how this could be done, all of which could be implemented.
Improvement Request Example API
Dataclass-like API
from view import body, Style
class MyStyle(Style, cls="my_class"):
font_family = ["sans-serif"]
body(style=MyStyle)
body(cls="my_class")CSS Loading API
from view import body, css
body(style=css("index.css"))Object API
from view import styled, body
my_class = styled(font_family=["sans-serif"])
body(style=styled(font_family=["sans-serif"]))
body(cls=my_class) # perhaps some magic could be done to make it accessible via cls="my_class" (not a variable reference)Anything else?
Waiting on #12, of course.
Metadata
Metadata
Assignees
Labels
apiThis has to do with the Python API (view)This has to do with the Python API (view)complexThis should only be looked at by someone who knows what they're doingThis should only be looked at by someone who knows what they're doingdelayedDelayed due to another issueDelayed due to another issueimprovementImprovement to an existing featureImprovement to an existing feature