Coder Social home page Coder Social logo

Comments (10)

ljharb avatar ljharb commented on May 3, 2024 21

@timothyneiljohnson Now that Github has reactions, please use those to +1 in the future instead of adding comment noise. Thanks!

from css.

ai avatar ai commented on May 3, 2024 11

@lencioni Stylelint is already used by:

Using Stylelint is especially reasonable, because Stylelint copy ESLint architecture. If you like ESLint, you will love Stylelint too — same benefits.

from css.

ntwb avatar ntwb commented on May 3, 2024 7

From the README.md

  1. CSS
    • Formatting
      • Use soft tabs (2 spaces) for indentation: 'indentation': 2,
      • Do not use ID selectors: 'selector-no-id': true,
      • When using multiple selectors in a rule declaration, give each selector its own line: 'selector-list-comma-newline-after': 'always',
      • Put a space before the opening brace { in rule declarations: 'block-opening-brace-space-before': 'always',
      • In properties, put a space after, but not before, the : character: 'declaration-colon-space-after': 'always', and 'declaration-colon-space-before': 'never',
      • Put closing braces } of rule declarations on a new line: 'block-closing-brace-newline-before': 'always',
      • Put blank lines between rule declarations: 'rule-non-nested-empty-line-before': ['always', { ignore: ['after-comment'], }],
    • Comments
      • Prefer line comments (// in Sass-land) to block comments.
        • CSS: 'no-invalid-double-slash-comments': true, Ignored in Sass-land
      • Prefer comments on their own line. Avoid end-of-line comments: 'comment-empty-line-before': ['always', {ignore: ['stylelint-commands'],}],
      • Write detailed comments for code that isn't self-documenting:
        • Uses of z-index: n/a
        • Compatibility or browser-specific hacks: you might want to use no-browser-hacks rule with the warning severity
    • OOCSS and BEM
    • Border
  2. Sass
  3. Not Implemented for CSS formatting:
    • Prefer dashes over camelCasing in class names. Underscores and PascalCasing are okay if you are using BEM (see OOCSS and BEM below), use selector-class-pattern with a regular expression matching your pattern
  4. Suggestions, I've deliberately left out many rules and only covered as much as I could the Airbnb CSS / Sass Styleguide as it is written, I'd suggest reviewing these for additional rules:

from css.

gaurav21r avatar gaurav21r commented on May 3, 2024 4

+1 👍

from css.

timothyneiljohnson avatar timothyneiljohnson commented on May 3, 2024 2

+1 👍

from css.

ai avatar ai commented on May 3, 2024 1

Stylelint become the most popular CSS linter from npm: http://www.npmtrends.com/csslint-vs-csscomb-vs-stylelint

from css.

ntwb avatar ntwb commented on May 3, 2024 1

@michaelBenin The pull request is in #23, I'm happy to refresh it, update, add whatever Travis CI configuration is needed etc

from css.

michaelBenin avatar michaelBenin commented on May 3, 2024

Hello, there hasn't been much action in this thread and I'm hoping to revive it. Is airbnb open to a pr for this?

from css.

ljharb avatar ljharb commented on May 3, 2024

@michaelBenin yes, as long as it includes the right travis config so that it can be automatically verified :-)

from css.

andykenward avatar andykenward commented on May 3, 2024

Going to close this as its been a few years.

from css.

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.