Skip to content
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

semantic aliasing #67

Open
ctaepper opened this issue Nov 3, 2017 · 1 comment
Open

semantic aliasing #67

ctaepper opened this issue Nov 3, 2017 · 1 comment

Comments

@ctaepper
Copy link

ctaepper commented Nov 3, 2017

all right, so we use this

  "typeScale": [
    3.25, 2.5, 1.25, 1, 0.75
  ],

to generate this

/*
  TYPE SCALE
  Docs: http://tachyons.io/docs/typography/scale/

  Base:
    f = font-size

  Modifiers:
    1 = 1st step in size scale
    2 = 2nd step in size scale
    3 = 3rd step in size scale
    4 = 4th step in size scale
    5 = 5th step in size scale
*/
.f1 { font-size: 3.25rem; }
.f2 { font-size: 2.5rem; }
.f3 { font-size: 1.25rem; }
.f4 { font-size: 1rem; }
.f5 { font-size: .75rem; }

This is totally fine, it's the tachyons way. however, communicating to a larger team when to use which font size is not always easy. Adding semantic meaning to scales helps making them easier to understand and read

Semantic proposal:

  "typeScale": [
    {"value": 3.25, "alias": "title"},
    {"value": 2.5, "alias": "sub"},
    {"value": 1.25, "alias": ["copy", "error"]},
    1,
    0.75
  ],

would generate this

/*
  TYPE SCALE
  Docs: http://tachyons.io/docs/typography/scale/

  Base:
    f = font-size

  Modifiers:
    1 = title
    2 = sub
    3 = copy, error
    4 = 4th step in size scale
    5 = 5th step in size scale
*/
.f1, .ftitle { font-size: 3.25rem; }
.f2, .fsub { font-size: 2.5rem; }
.f3, .fcopy, .ferror { font-size: 1.25rem; }
.f4 { font-size: 1rem; }
.f5 { font-size: .75rem; }

what do you think?

@johno
Copy link
Member

johno commented Nov 4, 2017

This is great!

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

No branches or pull requests

2 participants