Giter VIP home page Giter VIP logo

Comments (7)

ashleynolan avatar ashleynolan commented on May 18, 2024

Not sure on this one – but I think it depends on how you think changing them would be useful.

Most of the time, the .h1/.alpha classes should be used for overriding the base header sizes. By making them more generic, it’s encouraging more use of classes on elements outside of this to set font-size.

I’m unsure if this is a good thing or not – personally, I would rather people use the $type- variables in their Sass than to use .type- classes in the HTML. At least that way if you ever change one of them and need to see what it will affect, you don’t have to then search throughout your markup for what components use that type-size – instead it’s all within your CSS.

Not sure if I’m missing something that makes more of a case for the pros in changing them though?

from kickoff.

CiaranPark avatar CiaranPark commented on May 18, 2024

Agreed, I think we should try to enforce more rules on good typography and sizing. Allowing helper classes like this would perhaps mean lot's of shoe-horning of the design and weird font-sizing? I like it is currently, just need to be more strict with them personally.

from kickoff.

mrmartineau avatar mrmartineau commented on May 18, 2024

you don’t have to then search throughout your markup for what components use that type-size – instead it’s all within your CSS.

@ashleynolan isn't this the case already? These would replace the .h1 and .alpha to something that is more universal/able to be used on smaller sizes.

I like the idea of being able to give an element the font-size of an h1 but not all it's other styling (margins etc). I also think that it more clearly shows users what each major element's font sizes are.

from kickoff.

ashleynolan avatar ashleynolan commented on May 18, 2024

It’s the case for headers, for sure, but it would then become a larger issue with type-specific classes being used potentially for anything. I think having header classes like .h1/.alpha isn’t ideal either, but it’s a common use-case and so solves a fixed problem.

I think it is making the markup more tightly coupled to a styling variable that is prone to change and could potentially cause issues down the line. Changing the size of one of my type variables would require me to hunt down uses throughout the markup and possibly JS (if people added classes/markup in there too). Again, this would happen with the heading helper classes currently but at least by it’s definition it’s implied to be limited to use with headers.

I just think font-size, like colour, is too vulnerable to change from my experience – having helper layout classes is more robust and makes sense – it would be like having a .color-primary class to add to elements. It makes things more fragile.

from kickoff.

mrmartineau avatar mrmartineau commented on May 18, 2024

OK, you make a good case, I do not think this is a good idea, but should we remove the .h1 / .alpha classes then? Devs can add them if they need to..

from kickoff.

ashleynolan avatar ashleynolan commented on May 18, 2024

I don’t mind – I guess it’s weighing up the usefulness versus the fragility of them.

I think they’re pretty useful just for header sizing, but if we think it’d be better to get rid of them – or at least one of them as I don’t think we need both in there – then that could be a good idea.

from kickoff.

mrmartineau avatar mrmartineau commented on May 18, 2024

OK, @CiaranPark, what do you think?

from kickoff.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.