All Projects → ecmel → vscode-html-css

ecmel / vscode-html-css

Licence: MIT License
Visual Studio Code Extension - CSS Intellisense for HTML

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to vscode-html-css

code-connect
Open a file in your locally running Visual Studio Code instance from arbitrary terminal connections.
Stars: ✭ 44 (-45.68%)
Mutual labels:  visual-studio-code
vscode-kafka
Apache Kafka® extension for Visual Studio Code
Stars: ✭ 64 (-20.99%)
Mutual labels:  visual-studio-code
electron-vue-typescript-starter
🔩 An Electron starter that supports VueJS + TypeScript.
Stars: ✭ 80 (-1.23%)
Mutual labels:  visual-studio-code
DataverseDevTools-VSCode
The all-in-one tool to develop code for Dataverse/Dynamics 365. Helps you connect to a Dataverse environment, generate TypeScript definitions for entities, create a different type of Dataverse-specific projects, and much more.
Stars: ✭ 18 (-77.78%)
Mutual labels:  visual-studio-code
vscode-extern
VS Code API externs for Haxe
Stars: ✭ 36 (-55.56%)
Mutual labels:  visual-studio-code
Fruit-Ninja-Replica
this is a 2D game made by unity, it's a replica of the Game Fruit Ninja
Stars: ✭ 16 (-80.25%)
Mutual labels:  visual-studio-code
papyrus-lang
📜Advanced language tools for the Papyrus scripting language.
Stars: ✭ 65 (-19.75%)
Mutual labels:  visual-studio-code
vscode-terraform-doc-snippets
Snippets in vscode for all resources and data sources, as yanked directly from provider docs.
Stars: ✭ 26 (-67.9%)
Mutual labels:  visual-studio-code
tdd roman csharp
Kata: TDD Arabic to Roman Numerals with C#
Stars: ✭ 14 (-82.72%)
Mutual labels:  visual-studio-code
gruvbox-material-vscode
Gruvbox Material for Visual Studio Code
Stars: ✭ 143 (+76.54%)
Mutual labels:  visual-studio-code
vscode-highlight-bad-chars
Extension to highlight bad characters such as No-break space ( ) and the Greek question mark (;) in your source files.
Stars: ✭ 28 (-65.43%)
Mutual labels:  visual-studio-code
vscode-mongodb
MongoDB extension for Visual Studio Code
Stars: ✭ 30 (-62.96%)
Mutual labels:  visual-studio-code
AutoIt-VSCode
AutoIt Extension for Visual Studio Code
Stars: ✭ 51 (-37.04%)
Mutual labels:  visual-studio-code
gray-matter
A colour scheme for Sublime Text and Visual Studio Code that takes design cues from popular minimalist Markdown text editors.
Stars: ✭ 69 (-14.81%)
Mutual labels:  visual-studio-code
GitHub-Web-IDE
⚡ Open GitHub repositories in online web IDE
Stars: ✭ 242 (+198.77%)
Mutual labels:  visual-studio-code
TypeGame
👾 Sokoban Game in Pure TypeScript Type System
Stars: ✭ 222 (+174.07%)
Mutual labels:  visual-studio-code
vscode-iot-utility
IoT Utility for Visual Studio Code: Arduino, Espressif, Raspberry Pi, mbed and more
Stars: ✭ 61 (-24.69%)
Mutual labels:  visual-studio-code
vscode-open-in-github
Visual Studio Code Extension — Open file in GitHub
Stars: ✭ 35 (-56.79%)
Mutual labels:  visual-studio-code
openapi-lint-vscode
OpenAPI 2.0/3.0.x intellisense, validator, linter, converter and resolver extension for Visual Studio Code
Stars: ✭ 47 (-41.98%)
Mutual labels:  visual-studio-code
vscode-csharp-snippets
Extension of C# Snippets for Visual Studio Code
Stars: ✭ 22 (-72.84%)
Mutual labels:  visual-studio-code

Visual Studio Code CSS Intellisense for HTML

HTML id and class attribute completion for Visual Studio Code.

Features

  • HTML id and class attribute completion.
  • Supports linked and embedded style sheets.
  • Supports template inheritance.
  • Supports additional style sheets.
  • Supports other HTML like languages.
  • Validates CSS selectors on demand.

Usage

You can view a list of id and class attribute suggestions via ctrl + space.

Linked and Embedded Style Sheets

Linked [<link rel="stylesheet">] and embedded [<style></style>] style sheets are used in completion for id and class attributes. Links support local and remote files. Absolute local file paths are relative to the workspace folder while others are relative to HTML file:

index.html

<!DOCTYPE html>
<html>

<head>
    <!-- Remote style sheet -->
    <link rel="stylesheet"
          href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
    
    <!-- Local style sheet relative to workspace folder -->
    <link rel="stylesheet" href="/style.css">

    <!-- Local style sheet relative to this file -->
    <link rel="stylesheet" href="style.css">
    
    <!-- Embedded style sheet -->
    <style>
        #content {
            display: block;
        }

        .internal {
            display: block;
        }
    </style>
</head>

<body>
    <div class="container external internal" id="content">
        <div class="row">
            <div class="col">1 of 2</div>
            <div class="col">2 of 2</div>
        </div>
    </div>
</body>

</html>

All local links point to the same file which is in the root of workspace folder:

style.css

.external {
    display: block;
}

Template Inheritance

Template inheritance is supported for the following tags:

{% extends "base" %}

@extends('base')

{{< base }}

{{> base }}

Styles defined in base.html will also be available for completion in home.html:

base.html

<!doctype html>
<html>

<head>
    <link rel="stylesheet"
          href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">

    <style>
        #content {
            display: block;
        }

        .internal {
            display: block;
        }
    </style>

    <title>{{ title }}</title>
</head>

<body>
    {% block content %}{% endblock %}
</body>

</html>

home.html

{% extends "base" %}

{% block content %}
<div id="content" class="container internal">
    <h1>Home</h1>
</div>
{% endblock %}

Additional Style Sheets

If it is not possible to specify local or remote styles in HTML or via template inheritance, they can be specified in VS Code settings per workspace folder in .vscode/settings.json and will suggest for all HTML files within that workspace folder.

Example

.vscode/settings.json

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

All relative paths will be evaluated relative to the file being edited. ${fileBasenameNoExtension} will be replaced with the file name of the file being edited without extension.

Supported Languages

Supported languages can be configured with the css.enabledLanguages setting. By default html is enabled:

{
    "css.enabledLanguages": [
        "html"
    ]
}

Extension can be configured to support any language where it makes sense such as nunjucks, twig, mustache, etc. You should also install corresponding language extension which registers the language id in VS Code.

This setting is application scoped and changing the setting requires restarting VS Code.

Commands

Validate Attributes

Validates all id and class attributes in the active editor.

Clear Cache

Clears file cache.

Installation

Extension can be installed from Visual Studio Code Marketplace.

Sponsor

https://www.buymeacoffee.com/ecmel

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].