Code Monkey home page Code Monkey logo

Comments (2)

rob-balfre avatar rob-balfre commented on September 14, 2024

Not sure what the benefit of this would be. Couldn't you just add a global css file with simple reset for box-sizing?

from ui.

d3dc avatar d3dc commented on September 14, 2024

@rob-balfre You can definitely do that. Coming from css-in-js, sometimes you don't have a root style sheet or at least its existence doesn't persist in my mental model.

I think there is some value to providing a set of sane defaults as a component. When I used Bootstrap, I would think of it as "having Reboot at the root" (and it included Reboot). Keeping the idea that a reset does exist in the programmer's mental model might be easier if the reset is in the component tree.

Box also exists as a layout primitive in grommet. It has lots of props related to aligning content.

I guess my thoughts there mostly relate to sharing e.g. a css variable for padding ala styled-system - which incidentally creates shows Box as:

import { typography, space, color } from 'styled-system'

const Box = styled('div')(
  typography,
  space,
  color
)

I'm not sure if this is something you're interested in adding or not. I think having a standardize "system" of variables would be great for component development. Tachyons et all aren't fully geared towards "just" variables...

from ui.

Related Issues (7)

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.