Code Monkey home page Code Monkey logo

Comments (3)

sarahdayan avatar sarahdayan commented on May 18, 2024 2

I believe this is why.

If you set a border-style to an element with border: none in a ruleset which selector has higher specificity, it overrides the fact that you set it to none. This breaks the open/closed principle .

from stylelint-config-sass-guidelines.

paceaux avatar paceaux commented on May 18, 2024 1

@sarahdayan I ended up publicly ranting about this issue on twitter where my conclusion similar to yours. It seems to lie within a use-case where, in the case of wanting to return border to an element, more work must be done with border: none than border-style: none or border-width: 0;

I think my chief complaint here is that in all of my investigation, this isn't explained. I think if this rule persists in the guidelines, it should have a proper error message that explains why.

from stylelint-config-sass-guidelines.

bjankord avatar bjankord commented on May 18, 2024

@paceaux This lint rule came from SCSS-Lint. From their docs, "border: 0 and border: none are fundamentally different, as they are both shorthands. The intent of this linter is to enforce consistency, rather than define which is "better.""

That's how I view this lint rule as well, it primarily drives consistency, but it also helps with some more nuanced use-cases around border styling. I don't really have a good answer beyond that but I really like demo and explanation with regards to the open/close principle from @sarahdayan.

I can updated the readme section on this rule to indicate that this rule is primarily about consistency.

from stylelint-config-sass-guidelines.

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.