aesthetic-suite / framework

🎨 Aesthetic is an end-to-end multi-platform styling framework that offers a strict design system, robust atomic CSS-in-JS engine, a structural style sheet specification (SSS), a low-runtime solution, and much more!
https://aestheticsuite.dev
MIT License
203 stars 5 forks source link

Global font familys of the same name should be allowed #13

Closed milesj closed 6 years ago

milesj commented 6 years ago

This pattern currently fails:

export default {
  CircularBook: {
    fontFamily: 'Circular',
    fontStyle: 'normal',
    fontWeight: 'normal',
    src:
      'url("fonts/Circular_Air-Book.woff2") format("woff2"), url("fonts/Circular_Air-Book.woff") format("woff")',
  },
  CircularBookItalic: {
    fontFamily: 'Circular',
    fontStyle: 'italic',
    fontWeight: 'normal',
    src:
      'url("fonts/Circular_Air-Book_Italic.woff2") format("woff2"), url("fonts/Circular_Air-Book_Italic.woff") format("woff")',
  },
};

Since fontFamily is identical, it throws "TypeError: Font face "Circular" has already been defined.". We should combine font family + property name for uniqueness.

milesj commented 6 years ago

Fixed in 2.0.