Coder Social home page Coder Social logo

Comments (7)

gregberge avatar gregberge commented on May 10, 2024 2

Hello @remorses, I don't think having to learn a new language to use xstyled is a good thing. We add alias for margin and padding because it is very commonly used especially in grids. But background is not a common property that you use everywhere.

Also background and backgroundColor does not have the same treatment. So it could be confusing.

I think it is a bad choice from styled-system to alias it. Let's see if other users want it!

from xstyled.

P1X3L avatar P1X3L commented on May 10, 2024 2

I would add bg AND bgColor to avoid any confusion.
bg would be the alias of background (and would need to be implemented as a style prop)
bgColor the alias of backgroundColor

As you said, I don't like bg being the alias of backgroundColor like styled-system does.

from xstyled.

seeden avatar seeden commented on May 10, 2024 1

I migrated from styled-system/rebass and was surprised why my "bg" not working :) I can live without it but I like this property as well. I tried to use it in the theme

import { css } from '@xstyled/styled-components';

export default {
  colors: {
    lineBackgroudColor: 'red',
  },
  sizes: {
    lineHeight: '1px',
  },
  block: {
    line: {
      default: css`
        height: lineHeight;
        bg: lineBackgroudColor;
      `,
    },
  },
};

from xstyled.

gregberge avatar gregberge commented on May 10, 2024

@P1X3L @theo-mesnil, your advice on this one?

from xstyled.

theo-mesnil avatar theo-mesnil commented on May 10, 2024

Hey !

Maybe is not the best choice from styled system but, if this exist on styled system, it's better to have it on xstyled :)

from xstyled.

gregberge avatar gregberge commented on May 10, 2024

OK, could someone make the PR to alias backgroundColor to bg?

Replace this line by an array https://github.com/smooth-code/xstyled/blob/master/packages/system/src/styles/backgrounds.js#L9 and add tests.

from xstyled.

gregberge avatar gregberge commented on May 10, 2024

@P1X3L @theo-mesnil we will stick to styled-system.

from xstyled.

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.