Giter VIP home page Giter VIP logo

vscode-postcss-language's Introduction

postcss-language

VSCode language support for PostCSS and SugarSS

package is based on Syntax Highlighting for PostCSS

Features

Syntax highlighting for: .pcss .postcss .sss

if you want this plugin to work for *.css file you need manually change "Language mode" in VSCode to PostCSS or add

"files.associations": {
  "*.css": "postcss"
}

to your settings.json (File -> Preferences -> Settings) if you want to treat all css files as postcss by default

Changed

  • Extension now using a language-server(based on vscode-css-extension and vscode-css-languageservice) and a language-client for an additional functionality, such as color decorators.

Known Issues

semicolon automatically added when expanding abbreviation in *.sss files

vscode-postcss-language's People

Contributors

baohouse avatar mhmadhamster avatar tohuw avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

vscode-postcss-language's Issues

DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

Whenever I open a PostCSS file the I get an error in the PostCSS language Server:

[Error - 15:30:18] (node:11705) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

Extension version: v2.1.0
VSCode version: 1.51.1

incorrect highlight for multiple nesting

given this example

.Text {
    &__bold {
        font-weight: bold;
    }
    &__red {
        color: red;
    }

    &__bold&__red {
        border: 1px red solid;
    }
}

produces such highlight

image

but it should look like this (but without comma)

image

Error on typing :host selector

I get an error when typing :host selector:
2017-05-12 11 47 11

TypeError: Cannot read property '0' of undefined at Parser.decl (/Users/equinusocio/.vscode/extensions/shinnn.stylelint-0.24.0/node_modules/postcss/lib/parser.js:203:25) at Parser.other (/Users/equinusocio/.vscode/extensions/shinnn.stylelint-0.24.0/node_modules/postcss/lib/parser.js:170:18) at Parser.loop (/Users/equinusocio/.vscode/extensions/shinnn.stylelint-0.24.0/node_modules/postcss/lib/parser.js:81:26) at parse (/Users/equinusocio/.vscode/extensions/shinnn.stylelint-0.24.0/

How to use /* */ for comments

When I press vscode‘s shortcut ctrl - /, the comments style is double slash comments style //, How can I use /* comments */ rather than //comments ? Thanks😊

Custom property.

Add allow custom property like "box: horizontal", "lost". Best way get this from stylelint rules:

"property-no-unknown": [true, {ignoreProperties: ['/lost*/', 'box', 'size']}],

Intellisense (autocomplete) variables from another file?

I don't suppose it would be possible to add support so that CSS Next variables in a separate file like below could pop up in my Intellisense autocomplete when I start typing something like z-index: var(--zind in another file?

:root {
  --zindex-dropdown: 1000;
  --zindex-overlay: 2000;
  --zindex-modal: 3000;
}

It would be hugely amazingly helpful if this were possible though!

Mixins

I am having trouble getting PostCSS mixins to work, the syntax is correct and the intellisense is spitting out syntax errors, everything else with the package works great it's just a bit of a bother to see errors when working with PostCSS that should be valid. Is there any work around for this, for that matter is anyone else experiencing a similar issue.

postcss mixins

Doesn't show color box

Hello,

with this plugin enabled I can't see color box like this:

screenshot from 2017-04-30 23-35-00

With plugin enabled it disappears.

File: .css.
VS Code: 1.11
OS: Linux Ubuntu 16.04

Does not respect CSS/SCSS validate setting

I use Stylelint in a project with Postcss which defines some non-standard css properties and rules.

In my workspace settings I have

  "css.validate": false,
  "scss.validate": false

Which is supposed to suppress validation warnings for css and scss. When I have this plugin installed with

  "files.associations": {
    "*.css": "postcss"
  }

I can not disable the warnings

screen shot 2017-05-07 at 3 15 06 pm

Is it possible to turn off the validation while retaining auto complete?

CSS Modules

How to enable CSS Modules support in this extension?

Emmet abbreviations in 1.15.1

Hi! Thanks for this plugin. Seems bug related to #3 and #4.
In postcss language and VS CODE 1.15.1 color square and autocomplete working good, but not emmet abbreviations :(
In usual css/less/sass language all fine. Can we fix that somehow?

Feature request: styled-jsx-postcss support

Please add support of styled-jsx-postcss.

Example app with styled-jsx-postcss:

export default () => (
  <div className='hello'>
    <p>Hello World</p>
    <style jsx>{`
      :global(:root) {
        --bgColor: green;
        --color: white;
      }
      .hello {
        font: 15px Helvetica, Arial, sans-serif;
        background: var(--bgColor);
        color: var(--color);
        padding: 100px;
        text-align: center;
        transition: 100ms ease-in background;
      }
      .hello:hover {
        color: color(var(--color) blackness(+80%));
      }
    `}</style>
  </div>
)

Also we have vscode-styled-jsx without support of postcss.

Very good plugin!

I just want to say thank you, this is must to have plugin if you're working with CSS. 👍

Autocomplete disappears

Hello,

if this plugin is enabled the autocomplete disappears, because the language mode is changed from CSS to PostCSS, I really like VS Code autocomplete, because it helps a lot, it will be very good to somehow fix this issue by having CSS language mode with coloring or PostCSS language mode, but with autocomplete.

Don't use PostCSS icon for `.css` files

Hello,

I think it's better to turn off by default .css icons, because I like to use this plugin https://marketplace.visualstudio.com/items?itemName=robertohuertasm.vscode-icons which have really good icons for VS Code and right now my .css files look like this:

screenshot from 2017-04-30 23-30-16

So my suggestion is to turn off by default icons for .css files and let people decide if they want use it.

File: .css.
VS Code: 1.11
OS: Linux Ubuntu 16.04

P.S. Tested, seems this happens only with this https://marketplace.visualstudio.com/items?itemName=robertohuertasm.vscode-icons enabled.

Doesn't work

I don't see syntax highlighting of *.pcss files with last version of VS Code, 1.30.2 currently.

Add autocomplete support for nested rules

I'm currently using postcss-nested, but this is valid for cssnext nesting features too.

When a rule is nested, the autocomplete only display values for pseudo-classes:

image

No longer supports nesting since 2.0.3

Since extension was updated to 2.0.3 /**/ comments now work as expected, but all nested rules are now being marked as errors. Is it possible this has something to do with the update or did I do anything wrong? Previously I had no problems with nested styles. Thanks!

screenshot-postcss

Syntax uses // instead of /* */ as comment

When using the postcss syntax, the command Toggle Line Comment adds a commentary to the css line using two slashes:

image

This syntax is from SASS commentaries, so this extension should add a comment with the original css syntax:

image

support for postcss-mixins

We are using postcss-mixins and we are getting some highlighting errors.

image

Is that to be expected or something we should add/configure.

What would it take to add postcss-mixins support? We can try to see if we can help.

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.