Coder Social home page Coder Social logo

atom-csscomb's Introduction

Sort CSS properties with CSSComb.

demo

Installation

$ apm install atom-csscomb

Usage

  • Packages > CSSComb > Sort properties
  • Context Menu > Sort properties
  • Command Palette ( + shift + P) > CSSComb: Comb

Configuration

To configure with .csscomb.json, just put it to workspace.

Preset config

Configure with presets (csscomb, zen, yandex).

Extend preset

Extend selected preset config with project config if exists.

License

MIT © Shogo Sensui

atom-csscomb's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

atom-csscomb's Issues

Add a new rule for Scss/Sass newlineBetweenSelectors

Hello,
Thanks for this plugin,

Can we add this useful rule for SCSS ?
// Add a new line between selectors
newlineBetweenSelectors: false!true

//  before
[♥-component~="accordion"] {
    border-bottom: 1px solid $mine-shaft;
    .a--title {
        align-items: center;
        &:hover,
        &:focus {
            cursor: pointer;
        }
        &.isClose {
            &:before {
                @include triangle(20px, $alto, down);
            }
        }
    }
}

// after
[♥-component~="accordion"] {
    border-bottom: 1px solid $mine-shaft;

    .a--title {
        align-items: center;

        &:hover,
        &:focus {
            cursor: pointer;
        }

        &.isClose {
            &:before {
                @include triangle(20px, $alto, down);
            }
        }
    }
}

Thanks

Uncaught TypeError: Cannot read property 'getGrammar' of undefined

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 0.179.0
System: Mac OS X 10.10.3
Thrown From: atom-csscomb package, v0.7.0

Stack Trace

Uncaught TypeError: Cannot read property 'getGrammar' of undefined

At /Users/lee/.atom/packages/atom-csscomb/lib/csscomb.coffee:34

TypeError: Cannot read property 'getGrammar' of undefined
  at Object.module.exports.execute (/Users/lee/.atom/packages/atom-csscomb/lib/csscomb.coffee:34:25)
  at atom-workspace.<anonymous> (/Users/lee/.atom/packages/atom-csscomb/lib/csscomb.coffee:21:64)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:243:29)
  at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:3:61)
  at CommandRegistry.module.exports.CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:156:19)
  at EventEmitter.<anonymous> (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:65:30)
  at EventEmitter.emit (events.js:116:17)

Commands

     -0:16.4 tree-view:copy (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
     -0:03.3 window:update-available (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-railscasts.theme-atom-dark-ui)
     -0:00.6 csscomb:execute (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "railscasts"
    ],
    "projectHome": "/Users/lee/code",
    "destroyEmptyPanes": false
  }
}

Installed Packages

# User
ScssBundle, v0.4.0
atom-backbone, v0.6.0
atom-csscomb, v0.7.0
coffee-lint, v0.7.3
coffee-refactor, v0.6.2
compass, v0.7.5
cucumber, v0.4.0
emacs-mode, v0.0.29
html2haml, v0.3.0
javascript-snippets, v1.0.0
js-refactor, v0.3.0
language-haml, v0.14.0
language-liquid, v0.2.0
language-yaml, v0.21.0
linter-scss-lint, v0.0.11
railscasts, v0.2.2
refactor, v0.4.1
rspec-snippets, v0.4.0

# Dev
No dev packages

Can't comb due to inability to recognize 'vw' or 'vh' as a valid unit for 'font-size'

I have the following CSS code:

.quote-text {
    font-family: "Playfair Display", serif;
    font-size: 1vw;
    font-weight: 400;
    font-style: italic;
}

But when I try to comb it with CSSComb, it fails to recognize vw or vh as a valid unit for font-size, or anything pertaining to text properties such as letter-spacing - hence it won't comb. Runs fine on the browser though.

Gives me the following error message:

Please check the validity of the block starting from line #19

18 | .header { 19*| font-family: "Raleway", sans-serif; 20 | font-weight: 100; 21 | font-size: 5vw;

Gonzales PE version: 3.0.0-28 Syntax: css

Doesn't work on nested declarations in SCSS?

It won't work on the following code for example.

nav {
  ul {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  li { display: inline-block; }
  //Comment
  a {
    display: block;
    padding: 6px 12px;
    text-decoration: none;
  }
}

Small issue with brackets

I get small issue when csscomb the css, see below the original CSS:

.cities {
  line-height: 36px;
  ul {
    margin-bottom: 0;
  }
  img {
    @extend .img-rounded;
    @extend .img-responsive;
  }
}

After comb:

.cities {
  line-height: 36px;
  ul {
    margin-bottom: 0;
}
  img {
    @extend .img-rounded;
    @extend .img-responsive;
}
}

All brackets going to left. Have a way to fix it? Thanks!

Failed to load the atom-csscomb package

This happens with the new versions of Atom:

Atom Version: 0.194.0 ⚠️ in 1.0 API Preview Mode ⚠️
System: Mac OS X 10.10.3
Thrown From: atom-csscomb package, v0.7.0

Stack Trace

Failed to load the atom-csscomb package

At Cannot read property 'getDirectories' of null

TypeError: Cannot read property 'getDirectories' of null
    at Object.<anonymous> (/Users/diegof/.atom/packages/atom-csscomb/lib/csscomb.coffee:13:40)
    at Object.<anonymous> (/Users/diegof/.atom/packages/atom-csscomb/lib/csscomb.coffee:85:4)
    at Module._compile (module.js:452:26)
    at Object.requireCoffeeScript (/Users/diegof/Applications/Atom.app/Contents/Resources/app.asar/node_modules/coffee-cash/lib/coffee-cash.js:85:19)
    at Module.load (module.js:347:32)
    at Function.Module._load (module.js:302:12)
    at Module.require (module.js:357:17)
    at require (module.js:376:17)
    at Package.module.exports.Package.requireMainModule (/Users/diegof/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:677:34)
    at /Users/diegof/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:170:28

Installed Packages

# User
atom-csscomb, v0.7.0
coffee-compile, v0.13.0
emmet, v2.3.8
file-icons, v1.5.4
html2jade, v0.7.0
jsonpp, v0.0.6
language-jade, v0.4.0
linter, v0.12.1
linter-coffeelint, v0.2.1
linter-jshint, v0.1.2
react, v0.11.6

# Dev
No dev packages

Object.dirname is deprecated.

Argument to path.dirname must be a string

Object.dirname (/Applications/Atom.app/Contents/Resources/app/src/electron-shims.js:9:10)
getConfig (/Users/saurabh.sachan/.atom/packages/atom-csscomb/index.js:74:47)
<unknown> (/Users/saurabh.sachan/.atom/packages/atom-csscomb/index.js:13:16)
Generator.next (null:null:null)
step (/Users/saurabh.sachan/.atom/packages/atom-csscomb/index.js:32:273)
<unknown> (/Users/saurabh.sachan/.atom/packages/atom-csscomb/index.js:32:443)

Package update never ends

Hello,

I'm trying to update CSScomb on my Atom.io editor, but update never ends. This is happening since last update.

Any clues?

Regards,

Fran

fallbacks

It's recommended that a color that uses rgba() (or any other modern way to define colors) have a fallback color a solid one to be exact, but when i comb my CSS, it'll put the fallback color under the rgba() color
color: #212121; color: rgba(0,0,0,87);

expected output should be that the solid hex code be above the rgba one;

you can check here for more details: https://github.com/CSSLint/csslint/wiki/Require-fallback-colors

Not respecting my .csscomb.json config

Having an issue with atom-csscomb not respecting my config defined in .csscomb.json.

I'm trying to sort includes, variables,... on top like so:

...
"sort-order": [
        [
            "$variable",
            "$import",
            "$extend",
            "$include"
        ],
        [
            "font",
            "font-family",
            "font-size",
            "font-weight",
            "font-style",
            "font-variant",
            "font-size-adjust",
            "font-stretch",
            "font-effect",
            "font-emphasize",
            "font-emphasize-position",
            "font-emphasize-style",
            "font-smooth",
            "line-height"
        ],
...

But the output still seems to be the default preset:

.tiles-listing {
    font-size: 0;
    margin: 0 $padding-large-horizontal*0.8;
    margin-bottom: $padding-large-vertical;
    @include clearfix();

    .tile-item {
        position: relative;
        float: left;
        width: 50%;
        padding-bottom: 50%;
        margin: 0;
        color: #fff;
        border-radius: 0 !important;
        @extend .card;
        border: $padding-large-horizontal*0.2 solid $base-background-color;
        font-size: $font-size-base;
    }
}

How can I debug this properly?

Failed to activate the atom-csscomb package

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.0.13
System: Microsoft Windows 8.1 Pro
Thrown From: atom-csscomb package, v1.8.4

Stack Trace

Failed to activate the atom-csscomb package

At Cannot find module 'csscomb'

Error: Cannot find module 'csscomb'
  at Module._resolveFilename (module.js:334:15)
  at Function.Module._resolveFilename (C:\Users\José\AppData\Local\atom\app-1.0.13\resources\app.asar\src\module-cache.js:383:52)
  at Function.Module._load (module.js:284:25)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at Object.<anonymous> (C:\Users\José\.atom\packages\atom-csscomb\index.js:15:16)
  at Module._compile (module.js:428:26)
  at Object.defineProperty.value [as .js] (C:\Users\José\AppData\Local\atom\app-1.0.13\resources\app.asar\src\compile-cache.js:169:21)
  at Module.load (module.js:353:32)
  at Function.Module._load (module.js:308:12)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at Package.module.exports.Package.requireMainModule (C:\Users\José\AppData\Local\atom\app-1.0.13\resources\app.asar\src\package.js:761:34)
  at Package.module.exports.Package.activateConfig (C:\Users\José\AppData\Local\atom\app-1.0.13\resources\app.asar\src\package.js:263:14)
  at Package.module.exports.Package.activateNow (C:\Users\José\AppData\Local\atom\app-1.0.13\resources\app.asar\src\package.js:241:14)
  at C:\Users\José\AppData\Local\atom\app-1.0.13\resources\app.asar\src\package.js:838:25
  at Emitter.module.exports.Emitter.emit (C:\Users\José\AppData\Local\atom\app-1.0.13\resources\app.asar\node_modules\event-kit\lib\emitter.js:82:11)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\José\AppData\Local\atom\app-1.0.13\resources\app.asar\src\command-registry.js:221:20)
  at CommandRegistry.handleCommandEvent (C:\Users\José\AppData\Local\atom\app-1.0.13\resources\app.asar\src\command-registry.js:3:61)
  at CommandRegistry.module.exports.CommandRegistry.dispatch (C:\Users\José\AppData\Local\atom\app-1.0.13\resources\app.asar\src\command-registry.js:145:19)
  at [object Object].jQuery.fn.trigger (C:\Users\José\AppData\Local\atom\app-1.0.13\resources\app.asar\src\space-pen-extensions.js:64:23)
  at EventEmitter.<anonymous> (C:\Users\José\AppData\Local\atom\app-1.0.13\resources\app.asar\src\window-event-handler.js:75:67)
  at emitTwo (events.js:87:13)
  at EventEmitter.emit (events.js:172:7)
  at EventEmitter.ipc.sendSync (C:\Users\José\AppData\Local\atom\app-1.0.13\resources\atom.asar\renderer\api\lib\ipc.js:21:31)
  at BrowserWindow.RemoteMemberFunction [as emit] (C:\Users\José\AppData\Local\atom\app-1.0.13\resources\atom.asar\renderer\api\lib\remote.js:140:29)
  at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (C:\Users\José\AppData\Local\atom\app-1.0.13\resources\app.asar\src\context-menu-manager.js:170:31)
  at HTMLDocument.<anonymous> (C:\Users\José\AppData\Local\atom\app-1.0.13\resources\app.asar\src\window-event-handler.js:157:33)
  at HTMLDocument.handler (C:\Users\José\AppData\Local\atom\app-1.0.13\resources\app.asar\src\space-pen-extensions.js:112:34)
  at HTMLDocument.jQuery.event.dispatch (C:\Users\José\AppData\Local\atom\app-1.0.13\resources\app.asar\node_modules\space-pen\vendor\jquery.js:4681:9)
  at HTMLDocument.elemData.handle (C:\Users\José\AppData\Local\atom\app-1.0.13\resources\app.asar\node_modules\space-pen\vendor\jquery.js:4359:46)

Commands

     -0:32.5.0 autocomplete-plus:activate (atom-text-editor.editor.is-focused.autocomplete-active)
  2x -0:32 core:backspace (atom-text-editor.editor.is-focused.autocomplete-active)
     -0:31.5.0 editor:newline (atom-text-editor.editor.is-focused)
     -0:30.9.0 core:move-up (atom-text-editor.editor.is-focused)
     -0:29.7.0 autocomplete-plus:confirm (atom-text-editor.editor.is-focused.autocomplete-active)
     -0:29.7.0 snippets:expand (atom-text-editor.editor.is-focused.autocomplete-active)
     -0:28.7.0 core:undo (atom-text-editor.editor.is-focused)
  2x -0:27.8.0 core:backspace (atom-text-editor.editor.is-focused)
     -0:27.2.0 snippets:next-tab-stop (atom-text-editor.editor.is-focused)
     -0:27.2.0 snippets:expand (atom-text-editor.editor.is-focused)
     -0:27.2.0 editor:indent (atom-text-editor.editor.is-focused)
     -0:26.7.0 core:backspace (atom-text-editor.editor.is-focused)
     -0:26.2.0 autocomplete-plus:activate (atom-text-editor.editor.is-focused)
  5x -0:25.3.0 core:backspace (atom-text-editor.editor.is-focused.autocomplete-active)
  2x -0:23.5.0 editor:newline (atom-text-editor.editor.is-focused)
  2x -0:10.7.0 core:save (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "atom-dark-syntax"
    ],
    "disabledPackages": [
      "emmet"
    ]
  },
  "atom-csscomb": {
    "configureWithJSON": true
  }
}

Installed Packages

# User
atom-beautify, v0.28.12
atom-csscomb, v1.8.4
auto-indent, v0.5.0
color-picker, v2.0.11
highlight-line, v0.11.0
linter, v1.5.2
minimap, v4.13.3
project-manager, v2.5.1

# Dev
No dev packages

Doesn't work with nested SCSS files

eg

nav {
  ul {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  li { display: inline-block; }
  //Comment
  a {
    display: block;
    padding: 6px 12px;
    text-decoration: none;
  }
}

Gets combed to

nav {
    ul
    {
        margin: 0;
    padding: 0;
    list-style: none;
}

li {
    display: inline-block;
}
    //Comment
    a {
    display: block;
    padding: 6px 12px;
    text-decoration: none;
}
}

Possible duplicate of #7
I am using version 1.6.3 on Atom version 1.0.5

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.