Giter Club home page Giter Club logo

Comments (2)

SaraVieira avatar SaraVieira commented on August 16, 2024

Hey !

Hi Sara! just trying to learn from your code!

That's your mistake right there 😂

Wonder if you could talk a little about why you use injectGlobal + remcalc instead of other maybe more common approaches?

I don't have a specific reason but some reasons why I started coding this way with styled components.

  • First I don't know how to css with nesting anymore and adding the inject global allows me to do nesting while a normal css file would not.
  • Then I also think it's helpful the fact that I can still use the theme colors in there so if I change that color it will reflect everywhere and if I used a CSS file that would not be the case.
  • Inject global then also allows me to use it in other places I need some global styles like in here for the modal:https://github.com/SaraVieira/awesome-talks/blob/master/src/Components/Nav.js#L63 and this way I can keep the whole thing consistent.
  • About remcalc that is just because I find it very hard to see calc and convert it back to px and since the lib is just 1kb I find it really helps me make sense of the code.

It may look a little weird and overly complicated at first glance I'll give you that ahah

All of that said this my way of coding and like anything it's subjective but I hope that makes sense to you 😄

from awesome-talks.

tsiq-swyx avatar tsiq-swyx commented on August 16, 2024

interesting. thank you very much! yea i know css in js is a very very unsolved problem so i'm always on the look out for how other people do it. i'm sure what i do (pure css + style tag 90% of the time, then styled-components) can't really be the "best" way.

from awesome-talks.

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.