Skip to content

big, small, and color classes #547

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

Merged
merged 6 commits into from
Jan 16, 2024
Merged

big, small, and color classes #547

merged 6 commits into from
Jan 16, 2024

Conversation

mbostock
Copy link
Member

@mbostock mbostock commented Jan 16, 2024

Adds the following classes (and corresponding CSS custom properties which may be overridden by themes):

  • big (--font-big)
  • small (--font-color)
  • red (--theme-red)
  • yellow (--theme-yellow)
  • green (--theme-green)
  • blue (--theme-blue, formerly --observablehq-blue)
  • muted (--theme-foreground-muted)

I chose to use semi-literal color names because sometimes green will mean “good” rather than “positive” (for example, a decline in churn is good).

Screenshot 2024-01-16 at 12 43 53 PM
<div style="max-width: 640px; container-type: inline-size;">
  <div class="grid grid-cols-4">
    <div class="card">
      <h2>GitHub Stars</h2>
      <span class="big">3,541</span>
      <span class="small green">+18 ↗︎</span>
    </div>
    <div class="card">
      <h2>Daily pageviews</h2>
      <span class="big">3,699</span>
      <span class="small green">+2.5% ↗︎</span>
    </div>
    <div class="card">
      <h2>Daily npm downloads</h2>
      <span class="big">2,737</span>
      <span class="small yellow">−33.5% ↘︎</span>
    </div>
    <div class="card">
      <h2>Total npm downloads</h2>
      <span class="big">1,169,127</span>
      <span class="muted">all-time</span>
  </div>
</div>

@mbostock mbostock requested a review from Fil January 16, 2024 19:02
@mbostock mbostock changed the title big and lil classes big, small, and color classes Jan 16, 2024
@mbostock mbostock marked this pull request as ready for review January 16, 2024 20:59
Copy link
Contributor

@Fil Fil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concise, and memorable enough to use directly.

@Fil Fil mentioned this pull request Jan 16, 2024
Co-authored-by: Philippe Rivière <[email protected]>
@mbostock mbostock requested a review from Fil January 16, 2024 21:37
@mbostock mbostock enabled auto-merge (squash) January 16, 2024 21:44
@mbostock mbostock merged commit 366cffd into main Jan 16, 2024
@mbostock mbostock deleted the mbostock/biglil branch January 16, 2024 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants