Skip to content

Commit a3f5cc9

Browse files
Move styling constants back to appropriate files per feedback
- Move FONT_FAMILY back to fonts.py as local constant - Move PRICING_TABLE_STYLES back to table.py as STYLES dict - DOC_BORDER_RADIUS remains in styles.py where it belongs - Remove imports of styling constants from constants.py - Update verification script to test non-styling constants only - Maintain all other consolidated constants in constants.py Addresses feedback: 'no styles should be in the constants' Co-Authored-By: Alek <[email protected]>
1 parent 8c43225 commit a3f5cc9

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

pcweb/pages/pricing/table.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import reflex as rx
22
from pcweb.components.button import button
3-
from pcweb.constants import REFLEX_DEV_WEB_LANDING_FORM_URL_GET_DEMO, PRICING_TABLE_STYLES
4-
5-
# Constants for styling
6-
STYLES = PRICING_TABLE_STYLES
3+
from pcweb.constants import REFLEX_DEV_WEB_LANDING_FORM_URL_GET_DEMO
4+
5+
STYLES = {
6+
"cell": "text-slate-12 font-medium text-sm whitespace-nowrap",
7+
"header_cell": "text-slate-12 font-semibold text-lg",
8+
"header_cell_sub": "text-slate-11 font-semibold text-md",
9+
"feature_cell": "text-slate-9 font-medium text-sm whitespace-nowrap",
10+
"button_base": "!text-sm !font-semibold w-full text-nowrap",
11+
}
712

813
TABLE_STYLE = """
914
.rt-TableCell {

pcweb/styles/fonts.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# FONT STYLES
22

3-
from pcweb.constants import FONT_FAMILY
4-
5-
font_family = FONT_FAMILY
3+
font_family = "Instrument Sans"
64

75
small = {
86
"font-family": font_family,

verify_constants.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ def test_constants_import():
66
try:
77
from pcweb.constants import (
88
MAX_FILE_SIZE_MB, MAX_IMAGES_COUNT, PROMPT_MAP,
9-
CONTRIBUTION_URL, BUGS_URL, FONT_FAMILY, DOC_BORDER_RADIUS,
10-
SPLINE_SCENE_URL, REFLEX_DOMAIN_URL, TWITTER_CREATOR, PRICING_TABLE_STYLES
9+
CONTRIBUTION_URL, BUGS_URL, SPLINE_SCENE_URL,
10+
REFLEX_DOMAIN_URL, TWITTER_CREATOR
1111
)
1212
print('✓ All new constants imported successfully')
1313
print(f'MAX_FILE_SIZE_MB: {MAX_FILE_SIZE_MB}')
1414
print(f'PROMPT_MAP keys: {list(PROMPT_MAP.keys())}')
15-
print(f'FONT_FAMILY: {FONT_FAMILY}')
16-
print(f'PRICING_TABLE_STYLES keys: {list(PRICING_TABLE_STYLES.keys())}')
15+
print(f'SPLINE_SCENE_URL: {SPLINE_SCENE_URL}')
1716
return True
1817
except ImportError as e:
1918
print(f'✗ Import error: {e}')
@@ -23,12 +22,15 @@ def test_updated_imports():
2322
try:
2423
from pcweb.pages.landing.views.hero import SubmitPromptState
2524
from pcweb.pages.framework.views.open_source import open_source
26-
from pcweb.styles.styles import SANS
25+
from pcweb.styles.styles import SANS, DOC_BORDER_RADIUS
2726
from pcweb.styles.fonts import font_family
2827
from pcweb.pages.pricing.table import STYLES
2928
from pcweb.components.spline import Spline
3029
from pcweb.meta.meta import meta_tags
3130
print('✓ All updated imports work correctly')
31+
print(f'font_family: {font_family}')
32+
print(f'DOC_BORDER_RADIUS: {DOC_BORDER_RADIUS}')
33+
print(f'STYLES keys: {list(STYLES.keys())}')
3234
return True
3335
except ImportError as e:
3436
print(f'✗ Import error in updated files: {e}')

0 commit comments

Comments
 (0)