SeanJM / atom-css-clean

A plugin for Atom which sorts and aligns CSS and SASS
MIT License
20 stars 2 forks source link

Cuts off after 26 lines #3

Closed HiveSolution closed 8 years ago

HiveSolution commented 8 years ago

Just gave this a shot.

The CSS i tested it on has 242 lines. When running the command the css is cut after 26 lines (on a closing bracket, but also dropping said bracket)

It sorts the contents of those 26 lines without problems. But drops the rest of my css.

SeanJM commented 8 years ago

HiveSolutions: Can you post the CSS file?

HiveSolution commented 8 years ago

Found the Problem. On the next line i have a :not selector.

a:not(.mdl-button):hover {

Removing this makes the package work again. Seems like it's not able to handle the :not pseudo-selector

I created a gist containing the css so you can have a look. https://gist.github.com/HiveSolution/9101cb5a12c5ddec11d9

SeanJM commented 8 years ago

Alright, I have it working. There is a caveat, I now check CSS property names against a list of properties. It is the property list, which is also used for sorting, if you notice any properties which are missing let me know. I am not going to push what I have, until I have tested it for a few days:

list.properties = [
  'z-index',
  'content',
  'icon',
  'display',
  '*display',
  'box-sizing',
  'visibility',
  'appearance',
  '-moz-appearance',
  '-ms-appearance',
  '-webkit-appearance',
  'zoom',
  'position',
  'top',
  'right',
  'bottom',
  'left',
  'width',
  'min-width',
  'max-width',
  'height',
  'min-height',
  'max-height',
  'float',
  'clear',
  'clip',
  'margin',
  'margin-top',
  'margin-right',
  'margin-bottom',
  'margin-left',
  'padding',
  'padding-top',
  'padding-right',
  'padding-bottom',
  'padding-left',
  'color',
  'opacity',
  'overflow',
  'overflow-x',
  'overflow-y',
  'overflow-wrap',
  'background',
  'background-image',
  'background-color',
  'background-blend-mode',
  'background-repeat',
  'background-attachment',
  'background-origin',
  'background-position',
  'background-size',
  'background-clip',
  'filter',
  'border',
  'border-top',
  'border-right',
  'border-bottom',
  'border-left',
  'border-color',
  'border-image',
  'border-image-source',
  'border-image-repeat',
  'border-image-width',
  'border-image-outset',
  'border-image-slice',
  'border-top-color',
  'border-right-color',
  'border-bottom-color',
  'border-left-color',
  'border-width',
  'border-style',
  'border-radius',
  'border-top-left-radius',
  'border-top-right-radius',
  'border-bottom-right-radius',
  'border-bottom-left-radius',
  'border-top-width',
  'border-top-style',
  'border-right-width',
  'border-right-style',
  'border-bottom-width',
  'border-bottom-style',
  'border-left-width',
  'border-left-style',
  'border-collapse',
  'border-spacing',
  'outline',
  'outline-color',
  'outline-offset',
  'outline-style',
  'outline-width',
  'caption-side',
  'empty-cells',
  'table-layout',
  'box-shadow',
  '-moz-box-shadow',
  '-ms-box-shadow',
  '-webkit-box-shadow',
  'box-decoration-break',
  'text-align',
  'text-decoration',
  'text-decoration-color',
  'text-decoration-line',
  'text-decoration-style',
  'text-underline-position',
  'text-transform',
  'text-shadow',
  'text-align-last',
  'text-combine-upright',
  'text-indent',
  'text-justify',
  'text-orientation',
  'text-combine-upright',
  'text-overflow',
  'vertical-align',
  'align-content',
  'align-items',
  'align-self',
  '@font-feature-values',
  'font-feature-settings',
  'font',
  'font-family',
  'font-size',
  'font-size-adjust',
  'font-style',
  'font-weight',
  'font-kerning',
  'font-stretch',
  'font-synthesis',
  'font-variant',
  'font-variant-alternates',
  'font-variant-caps',
  'font-variant-east-asian',
  'font-variant-ligatures',
  'font-variant-numeric',
  'font-variant-position',
  'font-language-override',
  'src',
  'flex',
  'flex-basis',
  'flex-direction',
  'flex-flow',
  'flex-grow',
  'flex-shrink',
  'flex-wrap',
  'justify-content',
  'order',
  'hanging-punctuation',
  'line-break',
  'hyphens',
  'line-height',
  'letter-spacing',
  'tab-size',
  'white-space',
  'word-break',
  'word-spacing',
  'word-wrap',
  'direction',
  'unicode-bidi',
  'writing-mode',
  'list-style',
  'list-style-image',
  'list-style-position',
  'list-style-type',
  'counter-increment',
  'counter-reset',
  '@keyframes',
  'animation',
  'animation-delay',
  'animation-direction',
  'animation-duration',
  'animation-fill-mode',
  'animation-iteration-count',
  'animation-name',
  'animation-play-state',
  'animation-timing-function',
  'backface-visibility',
  'perspective',
  'perspective-origin',
  'transform',
  '-moz-transform',
  '-ms-transform',
  '-webkit-transform',
  'transform-origin',
  '-moz-transform-origin',
  '-ms-transform-origin',
  '-webkit-transform-origin',
  'transform-style',
  '-moz-transform-style',
  '-ms-transform-style',
  '-webkit-transform-style',
  'transition',
  '-moz-transition',
  '-ms-transition',
  '-webkit-transition',
  'transition-property',
  '-moz-transition-property',
  '-ms-transition-property',
  '-webkit-transition-property',
  'transition-duration',
  '-moz-transition-duration',
  '-ms-transition-duration',
  '-webkit-transition-duration',
  'transition-timing-function',
  '-moz-transition-timing-function',
  '-ms-transition-timing-function',
  '-webkit-transition-timing-function',
  'transition-delay',
  '-moz-transition-delay',
  '-ms-transition-delay',
  '-webkit-transition-delay',
  'ime-mode',
  'Multi-column',
  'break-after',
  'break-before',
  'break-inside',
  'column-count',
  'column-fill',
  'column-gap',
  'column-rule',
  'column-rule-color',
  'column-rule-style',
  'column-rule-width',
  'column-span',
  'column-width',
  'columns',
  'widows',
  'orphans',
  'page-break-after',
  'page-break-before',
  'page-break-inside',
  'marks',
  'quotes',
  'image-orientation',
  'image-rendering',
  'image-resolution',
  'object-fit',
  'object-position',
  'mask',
  'mask-type',
  'mark',
  'mark-after',
  'mark-before',
  'phonemes',
  'rest',
  'rest-after',
  'rest-before',
  'voice-balance',
  'voice-duration',
  'voice-pitch',
  'voice-pitch-range',
  'voice-rate',
  'voice-stress',
  'voice-volume',
  'marquee-direction',
  'marquee-play-count',
  'marquee-speed',
  'marquee-style',
  'nav-index',
  'nav-up',
  'nav-right',
  'nav-down',
  'nav-left',
  'cursor',
  'resize',
  'user-select',
  '-moz-user-select',
  '-ms-user-select',
  '-webkit-user-select',
];
SeanJM commented 7 years ago

I’ll add a test for that. Thank you.

On Mar 1, 2016, at 8:24 AM, Robin Ostwald notifications@github.com wrote:

Found the Problem. On the next line i have a :not selector.

a:not(.mdl-button):hover {

Removing this makes the package work again. Seems like it's not able to handle the :not pseudo-selector

I created a gist containing the css so you can have a look. https://gist.github.com/HiveSolution/9101cb5a12c5ddec11d9 https://gist.github.com/HiveSolution/9101cb5a12c5ddec11d9 — Reply to this email directly or view it on GitHub https://github.com/SeanJM/css-clean/issues/3#issuecomment-190723587.