-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the system_fonts()
helper function
#158
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a comment on improving font stacks code
if name not in font_stack_names: | ||
raise ValueError(f"Invalid font stack name: {name}") | ||
|
||
if name == "system-ui": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this a dictionary? Something like...
FONT_STACKS = {
"system-ui": ["system-ui", "sans-serif"],
"transitional": ...
}
Then system fonts could return something like FONT_STACKS[name] (with handling for emojis, and erroring on bad font stack name.
It might be worth putting FONT_STACKS
its own file (similar to _data_color/constants.py
), or maybe isn't too bad at the top of _helpers.py
Will merge this even in it's early state (agreement from pairing). But will revisit again. |
This introduces the
system_fonts()
helper function, and this allows for obtaining a list of themed fonts, the collection of which is expected to work well across computing platforms. There are 15 font stacks in total, and the function is useful withintab_options()
(for thetable_font_names
parameter).Fixes: #157