Code Monkey home page Code Monkey logo

did1335 / html-slim-css-scss-class-completion Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gencer/scss-everywhere

0.0 2.0 0.0 1.65 MB

A Visual Studio Code extension that provides CSS class and ID atttribute completion with incremental build and usage explorer for the HTML class attribute based on the CSS/Template files in your workspace. Also supports React's className attribute.

Home Page: https://marketplace.visualstudio.com/items?itemName=gencer.html-slim-scss-css-class-completion

License: MIT License

TypeScript 96.75% JavaScript 3.25%

html-slim-css-scss-class-completion's Introduction

IntelliSense for CSS, SCSS class and ID names in HTML, Latte, Slim...

Note: This is drop-in replacement for https://github.com/zignd/HTML-CSS-Class-Completion. Please uninstall that extension before installing this. Otherwise, things can happen.

Find usages:

ID Support:

Features

  • Gives you autocompletion for CSS class definitions that can be found in your workspace (defined in CSS files or the in the file types listed in the Supported Language Modes section)
  • Supports external stylesheets referenced through link elements in HTML files
  • Command to manually re-cache the class definitions used in the autocompletion
  • User Settings to override which folders and files should be considered or excluded from the caching process
  • Incremental build
  • Slim template support
  • Both-way SCSS support
  • Separate class and id support

Supported Language Modes

  • HTML
  • Razor
  • PHP
  • Laravel (Blade)
  • JavaScript
  • JavaScript React (.jsx)
  • TypeScript React (.tsx)
  • Vue (.vue) [requires octref.vetur]
  • Twig
  • Slim [requires Slim]
  • Latte [requires Latte extension]
  • Markdown (.md)
  • Embedded Ruby (.html.erb) [requires rebornix.Ruby]
  • Handlebars
  • EJS (.ejs)

Both directions (from CSS/SCSS to HTML, Latte... or from HTML, Latte to CSS/SCSS...) are supported. Only changed parts will be re-indexed so this will give you almost instant auto-completion.

Specific Support

  • "@apply" directive in CSS, SASS and SCSS Files for Tailwind CSS
  • "className" and "class" in TypeScript React, JavaScript and JavaScript React language modes
  • Emmet abbreviations support triggered by typing a "." (comes disabled by default, check the User Settings topic for more information)

Incremental Build

We introduced incremental build. In previous versions we need to re-cache all workspace for update cache. This causes high CPU and unnecessary delay to our development time. Hence, we introduced this feature. Once you open your VSCode workspace, initial scan will be made and all upcoming changes will be incrementally and instantly reflected to cache.

Contributions

You can request new features and contribute to the extension development on its repository on GitHub. Look for an issue you're interested in working on, comment on it to let me know you're working on it and submit your pull request! :D

What's new in this fork:

  • Added SCSS/SASS support without compiling whole package.
  • Ability to parse custom and magic functions
  • Ability to get remote css files such as bootstrap. Remote CSS files will appended to temp dir of your OS.
  • Ability to see Classes and IDs from .html and .slim in CSS and SCSS files.

When you work on .slim, whenever you press . dot, it will show you all relative class names. Addition to that also class="" tags are supported.

For SCSS part, I have manually strip comments and do regexp on code. In this way I also able to locate magic methods/classes. For example; If you have .u-pb-{class} this extension will show you .u-pb- and leave it class name filled by you.

Check out the changelog for the current and previous updates.

For more info check CHANGELOG.md

Usage

If there are HTML or JS files on your workspace, the extension automatically starts and looks for CSS class definitions. In case new CSS classes are defined, or new CSS files are added to the workspace, and you also want auto-completion for them, just hit the lightning icon on the status bar. Also, you can execute the command by pressing Ctrl+Shift+P(Cmd+Shift+P for Mac) and then typing "Cache CSS class definitions."

User Settings

The extension supports a few user settings, changes to these settings will be automatically recognized and the caching process will be re-executed.

Folders and Files

You can change the folders and files the extension will consider or exclude during the caching process by setting the following user settings:

  • "html-css-class-completion.includeGlobPattern" (default: "**/*.{css,scss,sass,html}")
  • "html-css-class-completion.excludeGlobPattern" (default: "")
  • "html-css-class-completion.remoteStyleSheets" (default: [])

Remote Files

    ...
	"html-css-class-completion.remoteStyleSheets": [
		"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css"
	],
	...

SCSS Find usage

When we include SCSS files to show usages, IntelliSense can be slow. This is false by default. To enable (you've been warned) set this setting to true and restart (required):

  "html-css-class-completion.enableScssFindUsage": true,

Template usage

When we include Template files to show usages, IntelliSense can be very slow. This is false by default. To enable (you've been warned) set this setting to true and restart (required):

  "html-css-class-completion.enableFindUsage": true,

Emmet

Emmet support comes disabled by default, the reason behind this choice is because it the current implementation simply triggers completion when you type a "." (period) and this behavior might be considered a little annoying, but it might change in the future.

Currently it supports the following languages (those are language identifier): "html", "eex", "latte", "razor", "php", "blade", "vue", "twig", "markdown", "erb", "handlebars", "ejs", "slim", "typescriptreact", "javascript", "javascriptreact".

  • "html-css-class-completion.enableEmmetSupport" (default: false)

html-slim-css-scss-class-completion's People

Contributors

allevaton avatar bypatryk avatar cvharris avatar egamma avatar gencer avatar grunxen avatar m2de avatar m4jing avatar pungggi avatar waqasibrahim avatar zignd avatar

Watchers

 avatar  avatar

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.