AgPerry's picture
Add files using upload-large-folder tool
4420fdb verified
Raw History Blame Contribute Delete
11.1 kB
"""Design tokens transcribed from source-observed CSS custom properties.
Evidence: materials/article/source-assets/evidence/design-tokens.json
(captured from https://www.article.com/ over the Mac SSH-tunnel browser).
Values are copied verbatim from the source stylesheet; none are invented.
"""
TOKENS = {
"--font-regular": ('"proxima_nova_regular", -apple-system, BlinkMacSystemFont, "Segoe UI", '
'Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", '
'"Segoe UI Emoji", "Segoe UI Symbol"'),
"--font-semibold": ('"proxima_nova_semibold", -apple-system, BlinkMacSystemFont, "Segoe UI", '
'Roboto, Helvetica, Arial, sans-serif'),
"--font-light": '"proxima_nova_light", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
"--font-bold": '"proxima_nova_bold", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
"--font-black": '"proxima_nova_black", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
"--grey-ultra-dark": "#2e2e2e",
"--grey-dark": "#626262",
"--grey-medium": "#a7a7a7",
"--grey-light": "#c2c2c2",
"--grey-ultra-light": "#f2f2f2",
"--grey-1": "#2e2e2e",
"--grey-2": "#828282",
"--grey-5": "#cacaca",
"--grey-6": "#efefef",
"--white": "#ffffff",
"--black": "#000000",
"--coral-dark": "#cc5046",
"--coral": "#ff6458",
"--coral-light": "#ffe0de",
"--green": "#3cb064",
"--amber": "#e6b94f",
"--accent-color": "var(--coral)",
"--primary-light-40": "#ffa29b",
"--error-color": "var(--coral-dark)",
"--warning-color": "var(--amber)",
"--success-color": "var(--green)",
"--background-color": "var(--grey-ultra-light)",
"--font-color": "var(--grey-1)",
"--font-accent-color": "var(--coral)",
"--font-inverted-color": "var(--white)",
"--border-color": "var(--grey-light)",
"--link-color": "inherit",
"--link-hover-color": "var(--grey-ultra-dark)",
"--overlay-color": "rgba(255, 255, 255, .7)",
"--shadow-color": "rgba(0, 0, 0, .2)",
"--font-size": "1rem",
"--font-size-12": ".75rem",
"--font-size-14": ".875rem",
"--font-size-16": "1rem",
"--font-size-20": "1.25rem",
"--font-size-24": "1.5rem",
"--font-size-32": "2rem",
"--font-size-48": "3rem",
"--font-size-64": "4rem",
"--font-size-96": "6rem",
"--line-height": "1.3",
"--line-height-32": "1.1",
"--line-height-48": "1.1",
"--line-height-100": "1",
"--line-height-110": "1.1",
"--line-height-130": "1.3",
"--line-height-150": "1.5",
"--space-unit": ".25rem",
}
ROOT_VARS = "\n".join(f" {k}: {v};" for k, v in TOKENS.items())
BASE_CSS = f""":root {{
{ROOT_VARS}
}}
*, *::before, *::after {{ box-sizing: border-box; }}
html {{ -webkit-font-smoothing: antialiased; }}
body {{
margin: 0; font-family: var(--font-regular); font-size: var(--font-size-16);
line-height: var(--line-height); color: var(--font-color); background: var(--white);
}}
a {{ color: var(--link-color); text-decoration: none; }}
a:hover {{ color: var(--link-hover-color); }}
img {{ max-width: 100%; display: block; }}
button {{ font-family: inherit; font-size: inherit; cursor: pointer; }}
.announcement {{
background: var(--black); color: var(--white); text-align: center;
font-size: var(--font-size-14); padding: 11px 40px; position: relative;
}}
.announcement a {{ color: var(--white); text-decoration: underline; font-family: var(--font-semibold); }}
.announcement .close {{ position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
background: none; border: 0; color: var(--white); font-size: 18px; line-height: 1; }}
.page-header {{ background: var(--white); border-bottom: 1px solid var(--grey-6); }}
.header-row {{ display: flex; align-items: center; gap: 24px; padding: 18px 40px 12px; }}
.logo {{ font-family: var(--font-bold); font-size: 25px; letter-spacing: .18em;
color: var(--grey-1); white-space: nowrap; }}
.logo .dot {{ color: var(--coral); }}
.search {{ flex: 1; max-width: 905px; position: relative; }}
.search input {{ width: 100%; padding: 12px 44px 12px 16px; font-size: var(--font-size-16);
border: 1px solid var(--grey-5); border-radius: 2px; font-family: inherit; color: var(--grey-1); }}
.search input::placeholder {{ color: var(--grey-2); }}
.search button {{ position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
background: none; border: 0; padding: 6px; color: var(--grey-1); }}
.header-icons {{ display: flex; align-items: center; gap: 20px; color: var(--grey-1); }}
.header-icons a {{ display: flex; align-items: center; position: relative; }}
.cart-count {{ font-size: var(--font-size-12); font-family: var(--font-semibold);
position: absolute; top: -6px; right: -9px; background: var(--coral); color: var(--white);
border-radius: 50%; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 4px; }}
.region-flag {{ width: 18px; height: 18px; border-radius: 50%; background: var(--coral);
display: inline-block; }}
.page-header {{ position: relative; }}
.main-nav {{ display: flex; gap: 26px; padding: 0 40px 14px; font-size: var(--font-size-16); }}
/* a narrow panel anchors to its own item; a full-bleed panel anchors to the
header, so its parent must not create a containing block */
.nav-item {{ position: relative; }}
.nav-item.mega-parent {{ position: static; }}
.main-nav a {{ color: var(--grey-1); padding: 4px 0; display: inline-block;
position: relative; }}
/* the nav row pads 14px below its links, leaving a gap the cursor would cross
on the way to the panel; this transparent bridge keeps the hover alive */
.nav-item > a::after {{ content: ""; position: absolute; left: 0; right: 0; top: 100%;
height: 20px; }}
.nav-item > a:hover {{ box-shadow: inset 0 -2px 0 var(--coral); }}
.main-nav a.sale {{ font-family: var(--font-semibold); }}
/* Source-observed dropdowns: a full-bleed masonry panel opening under the whole
header, and a narrow list anchored beneath its own nav item. Columns are
193px wide on a 233px pitch with a 33px line rhythm. */
.dropdown {{ position: absolute; top: 100%; z-index: 40; background: var(--white);
box-shadow: 0 12px 24px var(--shadow-color); visibility: hidden; opacity: 0;
transition: opacity .12s ease; }}
.nav-item:hover .dropdown, .dropdown:hover {{ visibility: visible; opacity: 1; }}
.dropdown.mega {{ left: 0; right: 0; width: 100%; padding: 16px 0; }}
/* the source lays the groups out as wrapping 193px columns on a 233px pitch */
.mm-masonry {{ padding: 0 40px; display: flex; flex-wrap: wrap;
align-items: flex-start; gap: 26px 40px; }}
.mm-col {{ width: 193px; }}
.dropdown.list {{ left: 0; padding: 13px 16px; }}
.mm-list {{ display: flex; flex-direction: column; }}
/* the nav rule sets inline-block on its anchors, so menu entries must win it
back or they run together on one line */
.main-nav .mm-head {{ display: block; padding: 0; font-family: var(--font-semibold);
font-size: var(--font-size-16); color: var(--grey-1); line-height: 33px; }}
.main-nav .mm-item {{ display: block; padding: 0; font-size: var(--font-size-16);
color: var(--grey-1); line-height: 33px; white-space: nowrap; overflow: hidden;
text-overflow: ellipsis; }}
.main-nav .mm-item:hover, .main-nav .mm-head:hover {{ color: var(--coral-dark);
box-shadow: none; }}
.container {{ padding: 0 40px; }}
.breadcrumb {{ font-size: var(--font-size-14); color: var(--grey-dark); padding: 16px 40px 6px; }}
.breadcrumb a {{ color: var(--grey-dark); }}
.breadcrumb span {{ margin: 0 6px; color: var(--grey-medium); }}
h1.page-title {{ font-family: var(--font-regular); font-size: var(--font-size-32);
line-height: var(--line-height-32); margin: 8px 0 4px; }}
.result-count {{ color: var(--grey-dark); font-size: var(--font-size-14); margin-bottom: 20px; }}
.product-grid {{ display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 40px 24px; padding: 0 40px 60px; }}
.product-card {{ display: block; color: inherit; }}
.product-card .thumb {{ background: var(--grey-ultra-light); aspect-ratio: 359 / 340;
overflow: hidden; position: relative; }}
.product-card .thumb img {{ width: 100%; height: 100%; object-fit: cover; }}
.product-card .name {{ margin-top: 14px; font-size: var(--font-size-16); line-height: var(--line-height-130); }}
.product-card .price {{ margin-top: 4px; font-family: var(--font-semibold);
font-size: var(--font-size-16); color: var(--coral-dark); }}
.tile-badge {{ position: absolute; top: 12px; left: 12px; background: var(--white);
color: var(--grey-1); font-family: var(--font-semibold); font-size: var(--font-size-14);
padding: 6px 12px; border-radius: 3px; }}
.swatch-row {{ display: flex; gap: 8px; margin-top: 12px; }}
.swatch-row .dot {{ width: 22px; height: 22px; border-radius: 50%; overflow: hidden;
display: inline-block; border: 1px solid var(--grey-5); }}
.swatch-row .dot.current {{ box-shadow: 0 0 0 2px var(--white), 0 0 0 3px var(--coral); }}
.swatch-row .dot img {{ width: 100%; height: 100%; object-fit: cover; }}
.price.on-sale, .pdp-price.on-sale, .pop-price.on-sale {{ display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
color: var(--coral-dark); }}
.price.on-sale s, .pdp-price.on-sale s, .pop-price.on-sale s {{ color: var(--grey-dark); font-family: var(--font-regular); }}
.price.on-sale .save, .pdp-price.on-sale .save, .pop-price.on-sale .save {{ color: var(--grey-1);
background: var(--coral-light); font-family: var(--font-semibold);
font-size: var(--font-size-14); padding: 4px 10px; border-radius: 3px; }}
.btn {{ display: inline-flex; align-items: center; justify-content: center; gap: 8px;
border: 1px solid transparent; border-radius: 999px; padding: 14px 30px;
font-family: var(--font-semibold); font-size: var(--font-size-14);
letter-spacing: .08em; text-transform: uppercase; }}
.btn.filled.coral {{ background: var(--coral); color: var(--white); }}
.btn.filled.coral:hover {{ background: var(--coral-dark); color: var(--white); }}
.btn.outlined.coral {{ background: transparent; color: var(--coral); border-color: var(--coral); }}
.btn.block {{ width: 100%; }}
.pagination {{ display: flex; justify-content: center; padding: 10px 0 70px; }}
.site-footer {{ background: var(--grey-ultra-light); margin-top: 40px; padding: 48px 40px 28px;
font-size: var(--font-size-14); }}
.footer-cols {{ display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; max-width: 1360px; }}
.footer-cols h4 {{ font-family: var(--font-semibold); font-size: var(--font-size-14);
margin: 0 0 14px; text-transform: uppercase; letter-spacing: .06em; }}
.footer-cols ul {{ list-style: none; margin: 0; padding: 0; }}
.footer-cols li {{ margin-bottom: 9px; }}
.footer-cols a {{ color: var(--grey-1); }}
.footer-legal {{ display: flex; gap: 20px; flex-wrap: wrap; margin-top: 34px;
padding-top: 20px; border-top: 1px solid var(--grey-5); color: var(--grey-dark); }}
.footer-legal a {{ color: var(--grey-dark); }}
"""