Spaces:
Build error
Build error
File size: 602 Bytes
e0ef1bb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# Programmatic way to generate `topic_detection.css`
css = ".istopic {\n" \
"color: #6b2bd6;" \
"\n}" \
"\n\n"
# Font size of highest level topic
starting_fs = 30
# Font size difference between topic and subtopic
fs_diff = 5
# Minimum font size of text
fs_min = 15
# Number of pixels to indent at each level
ind = 18
for i in range(10):
css += f".topic-L{i} {{\n" \
f"font-size: {max(starting_fs-i*fs_diff, fs_min)}px;\n" \
f"text-indent: {ind*i}px;\n" \
f"}}" \
f"\n\n"
with open('topic_detection.css', 'w') as f:
f.write(css)
|