vscode-html-css icon indicating copy to clipboard operation
vscode-html-css copied to clipboard

Path to local CSS files

Open plohoj opened this issue 4 years ago • 4 comments

Thanks for the extension, I suggest a couple of improvements for working with local css files:

  1. Add the ability to specify several files at once using a mask, for example, as in VSCode:

    "css.styleSheets": [
       "/node_modules/some_library/**/*.css",
       "/styles/**/*.css"
    ]
    

    Alternatively, you can use a regular expression or the ".ignore" style. This will help in cases where there are more CSS files with global styles.

  2. Add the ability to specify files relative to the currently open file, for example, using a variable in the path:

    "css.styleSheets": [
       "${fileDirname}/styles/*.css",
       "${fileDirname}/*.component.css"
    ]
    

    This will be useful for Angular applications in which the CSS file is relative to the HTML file or for any similar architecture of relative location.

plohoj avatar Dec 29 '20 12:12 plohoj

I agree, I've been using this extension for long since some days ago that I had to uninstall it becaose it now returns several errors just for local files (Angular project). The options css.styleSheets should support remote and local files, optionally with wildcard support too. Consider that there might be Angular projects with scss files only too.

DavideViolante avatar Dec 30 '20 10:12 DavideViolante

${fileBasenameNoExtension} is implemented in https://github.com/ecmel/vscode-html-css/commit/dd1b86d6f3f17135a5532a0f556790bac9f3b028

VS Code Variables Reference

ecmel avatar Jan 14 '21 18:01 ecmel

how to properly implement it in django

mdsadiqueinam avatar Aug 03 '21 14:08 mdsadiqueinam

{ "css.styleSheets": [ "https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css", "/style.css", "style.css", "${fileBasenameNoExtension}.css" ] } using this only works with bootstrap

mdsadiqueinam avatar Aug 03 '21 14:08 mdsadiqueinam

Implemented in 1.14.0

ecmel avatar Dec 28 '23 19:12 ecmel