Skip to main content
Version: Kiawah (2.7.0)

Legal Center Styling Contract

Your legal center's look is set in the management portal (Organization > Legal Center): a brand color, fonts, colors, a starter theme and, under Advanced, per-element colors. When you need more, add Custom CSS on the Content tab.

Custom CSS should only rely on the names on this page: the --tc-* CSS variables, the tc- class names and the part names. They are a versioned public API. We keep them working when we change the legal center's design; anything else in the page (other class names, element structure, Tailwind utilities) can change in any release.

Versions​

The current contract is version 1. The legal center root element carries it:

<div class="tc-legal-center tc-template-sidebar" data-tc-contract="1" data-tc-scheme="light" data-tc-view="document" data-tc-template="sidebar">
  • Additions (a new variable, class or part) don't change the version.
  • Renames and removals need a new version. The old name keeps working for at least one release after the new one ships, and both are listed here until then.
  • Changes are announced in the Changelog.

Where your CSS applies​

Your custom CSS is added in two places, each time after our own styles:

  1. The page (sidebar, navigation, breadcrumbs, header, footer). Our theme sets the variables on .tc-legal-center.
  2. The document frame, which shows the document text. The variables are set on :root there. The document's elements are direct children of <body class="tc-document-body tc-document">, so selectors like body > p work.

Our document styles have zero specificity, so any rule you write wins, for example h2 { color: #0a7cff; }. Inline styles in a document always win too.

Override a variable​

Override the brand color and the colors marked follows the brand in the table below update with it (in browsers that support color-mix(), which is every current browser). Text colors that sit on the brand or the page are contrast-checked by the editor and don't follow automatically: when you override --tc-color-brand, also set --tc-color-link and --tc-color-on-brand to colors that are readable.

Set variables on .tc-legal-center for the page and on :root for the document frame:

.tc-legal-center,
:root {
--tc-color-brand: #0a7cff;
--tc-color-link: #0a6ad8;
--tc-color-on-brand: #ffffff;
--tc-radius: 4px;
}

Style one part of the page​

.tc-legal-center .tc-group-header {
text-transform: uppercase;
letter-spacing: 0.04em;
}

.tc-legal-center .tc-document-item.tc-is-active {
font-weight: 600;
}

CSS variables​

Colors are hex values, except the ones that are other variables (var(--tc-color-brand)) or worked out from them (color-mix()). The dark variant (when Light or dark is Dark, or Auto on a device in dark mode) sets the same variables to dark colors, so CSS that uses the variables works in both.

VariableWhat it is
--tc-color-brandBrand color (active document, group headers, callout accents). Overriding it updates every color marked "follows the brand"
--tc-color-brand-hoverBrand color on hover (follows the brand)
--tc-color-brand-activeBrand color when pressed (follows the brand)
--tc-color-on-brandText drawn on the brand color (contrast-checked; set it too if you override the brand)
--tc-color-backgroundPage background
--tc-color-surfaceSidebar and panel background
--tc-color-surface-raisedBreadcrumb bar and raised panels
--tc-color-textBody text
--tc-color-mutedSecondary text (dates, version numbers)
--tc-color-borderBorders and dividers
--tc-color-linkLinks (a contrast-checked shade of the brand; set it too if you override the brand)
--tc-color-link-hoverLinks on hover (follows the link color)
--tc-color-link-on-surfaceLinks on the surface color and on tinted banners (header, footer, featured cards, the version banner), contrast-safe on all of them. If you override --tc-color-link, set this one too
--tc-color-nav-textNavigation bar links
--tc-color-hover-textText of a hovered document or navigation link
--tc-color-nav-hover-bgBackground of a hovered navigation link (follows the brand)
--tc-color-list-hover-bgBackground of a hovered document in the list (follows the brand)
--tc-color-version-hover-bgBackground of a hovered version in the version menu (follows the brand)
--tc-color-active-bgBackground of the open document in the list (= --tc-color-brand)
--tc-color-active-textText of the open document in the list (= --tc-color-on-brand)
--tc-color-group-header-bgDocument group header background (= --tc-color-brand)
--tc-color-group-header-textDocument group header text (= --tc-color-on-brand)
--tc-color-group-header-dividerDivider under a document group header
--tc-color-callout-bgCallout background in documents (follows the link color)
--tc-color-callout-borderCallout accent border in documents (follows the brand)
--tc-color-table-header-bgTable header background in documents
--tc-color-table-stripeAlternate table row background in documents
--tc-font-headingHeading font stack
--tc-font-bodyBody font stack
--tc-font-heading-synthesisfont-synthesis-weight for headings: none when the heading is a Google Fonts family without a bold weight (no fake bold), otherwise auto. Uploaded families are not covered: upload a Bold face to avoid a simulated bold.
--tc-font-size-baseBase text size (px)
--tc-line-heightBody line height
--tc-content-widthMaximum width of the document column
--tc-sidebar-widthSidebar width (only set when customized)
--tc-radiusCorner radius
--tc-shadowPanel shadow
--tc-spaceSpacing unit; scales with density
--tc-color-schemelight or dark (as used by the CSS color-scheme property)
--tc-color-diff-ins-bg, --tc-color-diff-ins-textComparing versions: background and text of added text (a darker variant in dark mode)
--tc-color-diff-del-bg, --tc-color-diff-del-textComparing versions: background and text of removed text

Fonts​

Pick the heading and body fonts on the Brand tab. Each one can come from:

  • System: a font already on your visitors' devices, such as Georgia or Arial. Nothing is downloaded.
  • Google Fonts: a family from the searchable list in the editor. The legal center loads it from fonts.googleapis.com with display=swap, so text shows in a fallback font until the web font arrives. Families that have true italics load them too.
  • Uploaded: your own .woff2 files (up to 2 MB each, 20 per organization). Upload one file per weight and style, for example Regular and Bold, under Uploaded fonts. ToughClicks serves them with long-lived caching.

The chosen fonts are loaded on the legal center page and inside the document frame, so --tc-font-heading and --tc-font-body already include them.

Privacy

When you use Google Fonts, each visitor's browser downloads the font from Google's servers, so Google receives the visitor's IP address. If you use Google Fonts, mention Google as a third party in your own privacy notice. If that conflicts with your privacy policy, upload the font files instead: uploaded fonts are served by ToughClicks.

Self-host a Google font​

Most Google Fonts use the SIL Open Font License, which allows self-hosting. Check the license shown on the font's page first.

  1. On fonts.google.com, open the family and choose Get font, then Download all.
  2. Use the files in the download's static folder (one file per weight and style), not the variable Family[wght].ttf. Convert the ones you need (for example Regular, Bold and Italic) to .woff2 with a converter such as woff2_compress or an online WOFF2 converter. Removing characters you don't need (subsetting) makes the file smaller.
  3. Under Uploaded fonts, upload each file with the same family name and its weight and style.
  4. Pick the family under Uploaded for the heading or body font.

You can't delete any file of an uploaded font family while your draft or published legal center uses that family. Choose another font, save the draft (and publish), then delete it.

Class names​

ClassElement
tc-legal-centerThe root of the page. Attributes: data-tc-contract (contract version), data-tc-scheme (light or dark), data-tc-view (hub for the landing page, document)
tc-hubAdded to the root on the landing page, when no document is open
tc-sidebarThe sidebar with the logo and the document list
tc-logoThe logo (or organization name) button
tc-document-listThe list of documents
tc-document-itemOne document in the list; tc-is-active on the open one
tc-groupA document group
tc-group-headerA document group's header
tc-mainThe main column
tc-navigationThe navigation bar (your links)
tc-navigation-linkOne navigation link
tc-breadcrumbsThe breadcrumb bar
tc-headerYour custom header
tc-footerYour custom footer
tc-document-headerThe document title, version and published date
tc-document-titleThe document title (an h1)
tc-version-selectThe version selector
tc-published-dateThe published date
tc-document-frameThe frame that shows the document

Added in 2.7.0 (still contract version 1). The root carries tc-template-sidebar, tc-template-hub, tc-template-tabs or tc-template-bare, and data-tc-template with the same name, so CSS can target one template:

.tc-legal-center.tc-template-hub .tc-hub-heading {
font-size: 3rem;
}
ClassElement
tc-site-headerThe header built on the Header & footer tab; tc-site-header--sticky when it stays on screen (wider screens only), tc-site-header--menu-open while the phone menu is open
tc-site-menuThe menu button that holds the header links on phones (767px wide or less). In the Sidebar template on phones and tablets the header links sit at the bottom of the document drawer instead (tc-drawer-links) and the call-to-action is in the top bar (tc-mobile-cta)
tc-site-logoThe logo in that header
tc-site-nav, tc-site-nav-linkThe header links
tc-site-actionsThe "Back to site" link and the call-to-action button
tc-back-to-siteThe "Back to site" link
tc-ctaThe call-to-action button
tc-site-footerThe footer built on the Header & footer tab
tc-footer-columns, tc-footer-column, tc-footer-column-titleFooter link columns
tc-footer-linkA footer link
tc-footer-contactThe contact or DPO block (an address element)
tc-footer-bottomThe bottom row: copyright and privacy links
tc-copyrightThe copyright line
tc-cookie-settingsThe "Cookie settings" link. Without a URL it points to #cookie-settings, so a consent manager script can open its settings when it's clicked
tc-privacy-choicesThe "Your privacy choices" link (#privacy-choices without a URL)
tc-tabs, tc-tabThe document tabs of the Tabs template; tc-is-active on the open document; tc-tabs--fade-start / tc-tabs--fade-end while more tabs are scrolled out of view
tc-hub-pageThe hub page of the Hub + article template
tc-hub-heading, tc-hub-introThe hub heading and intro text
tc-hub-searchThe search box
tc-featured, tc-featured-cardFeatured documents and one card
tc-hub-groupA group on the hub page (tc-hub-group--sub for a subgroup)
tc-group-descriptionA group's one-line description
tc-hub-documentOne document in a hub list
tc-document-dateThe updated date next to a document
tc-upcoming-bannerThe banner for a version that takes effect later
tc-change-summary"What changed" for the version shown (plain text; line breaks are kept)
tc-document-layoutThe document frame and, when sticky, the table of contents
tc-tocThe table of contents; tc-toc--inline (above the document), tc-toc--sticky (beside it), and tc-toc--folded (the same list folded above the document on screens narrower than 1024px, and in the Sidebar template up to 1279px, where the document list takes part of the width)
tc-toc-linkA link in the table of contents
tc-version-archiveThe list of previous versions (not the current or an upcoming one) with their date ranges
tc-upcoming-banner--previousAdded to tc-upcoming-banner while a previous version is shown
tc-compare-linkA "Compare versions", "Compare with the previous version" or "See what changes" link
tc-redlineThe comparison of two versions (toolbar, legend and the compared text)

Inside the document frame:

ClassElement
tc-document-rootThe frame's html element
tc-document-bodyThe frame's body element
tc-documentAlso on the frame's body element: the document's elements are its direct children
tc-table-scrollA wrapper around each table that scrolls sideways on narrow screens
tc-section-anchorAn empty span with the section's stable id (id="section-4-2") at the start of each numbered section
tc-section-linkAdded to the tc-heading-anchor copy link of a numbered paragraph or list item (shown on hover)
tc-xrefA cross-reference turned into a link ("see Section 7")
tc-section-targetAdded for 2 seconds to the section a cross-reference just went to
tc-diff-insAdded text in a comparison (an ins element, underlined)
tc-diff-delRemoved text in a comparison (a del element, struck through)
tc-diff-noteA "[link address changed]" note after a link whose address changed
tc-diff-gap"…" standing for unchanged text in a very large comparison

Document typography​

The document stylesheet styles h1 to h4, paragraphs, lists, tables (with a header background and striped rows), blockquotes, code and images using the variables above. Long words and URLs wrap instead of running off the page. Two classes are available in your document text:

  • Numbered sections. <ol class="tc-numbered"> numbers nested items legal-style (1., 1.1., 1.1.1.). <ol data-tc-numbered> does the same. Other lists keep the browser's numbering (1., 2., 3. at every level).
  • Callouts. <div class="tc-callout"> (or <aside>) draws a highlighted box. Add tc-callout--warning or tc-callout--important for an amber or red accent.
  • Summaries. <aside class="tc-summary"> is a plain-English "short version" of a section, drawn with a brand-colored accent. An optional data-tc-label adds a small caption, for example data-tc-label="In short".
  • Summary boxes can be added in the document editor with Insert summary box: with text selected it wraps the selection, otherwise it adds an empty box with the cursor inside.
  • Heading anchors. Every heading gets an id made from its text (letters and digits of any script, other characters become -, repeats get -2, -3). When Copyable links next to headings is on, h1 to h4 also get an a.tc-heading-anchor link that copies the section's URL. Style the link with .tc-heading-anchor. Links to the ids headings had before 2.7.0 keep working: an empty span.tc-heading-alias with the old id sits at the start of the heading.
  • Section links. Every numbered section also gets an id from its clause number, not its text, so it doesn't change when other sections are edited: "4.2 Data retention" is #section-4-2, and "(b)" under 4.2 is #section-4-2-b. Numbers are read from headings and list items ("4.2", "4.", "Section 4", "Clause 3", "Article IV", "§ 9"), from paragraphs that start with a number and a title ("7.1 Fees"), and from <ol> positions (a list under a numbered heading gives that section's subsections, 5.1, 5.2; nested and alphabetic lists give 5.1.1 or 5-a). Sentences ("Section 7 does not apply…") and amounts ("2.5 Million", "10.00 USD") are not sections. The id sits on an empty span.tc-section-anchor at the start of the section; a numbered heading's copy link and table of contents entry use it. Copy links of numbered paragraphs are named with the document's own word ("Copy link to “Article 4.2”"). References such as "see Section 7", "Section 4.2(b)" or "Sections 4 and 5" become a.tc-xref links when that section exists. References to laws or other documents ("Articles 15 to 22 GDPR", "Section 4 of our Privacy Policy", "Section 4 DMCA") are not linked.
  • Comparing versions. Readers can compare two published versions side by side or inline (?compare=<version>). Added text is an ins.tc-diff-ins and removed text a del.tc-diff-del, colored with the --tc-color-diff-* variables, underlined or struck through. A changed link address gets a span.tc-diff-note (callout colors; the old and new address in its title).

Document frame height​

In every template the document frame is as tall as the document and the page scrolls (the Sidebar template's document list stays in view). Lengths in vh, vmin and vmax in document styles and custom CSS mean the reader's window, as on a normal page. The frame's html and body always get height: auto, min-height: 0 and overflow: visible (with !important), so custom CSS can't pin their height or hide the rest of the document. vh (also dvh, svh, lvh, vmin, vmax, vb) lengths in declarations are converted to px of the reader's window; class names, url() values and strings are left alone. Links to #heading inside a document scroll to that heading.

Release note (2.7.0): Sidebar centers now scroll as one page (the document list stays in view) instead of scrolling the document inside a fixed-height frame. Custom CSS that fixes the height or overflow of .legal-center-page, .legal-center-right or .version-content-iframe with !important may cut off documents: remove those rules. Existing documents also pick up the TCK-319 document stylesheet (headings, lists, tables).

Dates under the title​

The Date under the title setting shows Published <date> by default (documentPage.dateLabel published, also when the key is absent), Effective <date> (the version's effective date) or Last updated <date> (the publish date). All dates are shown as UTC calendar dates; effective dates start at 00:00 UTC.

The legal center shows the version with the latest effective date that isn't in the future (a version's effective date is its publish date when none is set). A version that takes effect later is announced in a banner with a preview link. The public versions list returns that version's id as currentVersionId.

<ol class="tc-numbered">
<li>Definitions
<ol>
<li>"Service" means ...</li>
</ol>
</li>
</ol>

<div class="tc-callout tc-callout--important">
<p>This section limits our liability.</p>
</div>

<aside class="tc-summary" data-tc-label="In short">
<p>You can cancel at any time and we refund the unused part of your plan.</p>
</aside>

Parts​

These elements also have a part attribute with a stable name: sidebar, logo, document-list, document-item, group-header, navigation, breadcrumbs, header, footer, document-title, document-frame, and since 2.7.0 site-header, site-footer, hub, tabs, toc, version-archive, change-summary, upcoming-banner, redline (and document in the frame). On the hosted legal center, style them with the class names above. Where the legal center is rendered inside a shadow root, such as an embedded legal center, use ::part():

toughclicks-legal-center::part(group-header) {
text-transform: uppercase;
}

Font names in CSS​

Font names are stored without quotes (for example Helvetica Neue, Arial, sans-serif); the page quotes each family when it builds --tc-font-heading and --tc-font-body. When you set a font in custom CSS, quote multi-word names yourself.

Keyboard focus​

Document list items, navigation links, group headers and the logo show a 2px outline in --tc-color-link when focused with the keyboard. If you change link colors, keep the outline visible.

Contrast​

The editor's readability check tests every text color against its backgrounds (WCAG AA, 4.5:1), names the setting that causes a problem, offers the nearest shade that reads well, and asks for confirmation before you publish text that may be hard to read. Custom CSS isn't checked: if you change colors in CSS, check the contrast yourself.