Copy CSS Selector
Quickly copy CSS selectors by hovering over HTML elements with class or id attributes.
Features
- 🎯 Quick copying - simply hover over class or id in HTML
- 📋 Automatic detection - extension automatically determines selector type (. for class, # for id)
- 🔧 Enhanced BEM support - automatic creation of all possible BEM variations for complex class structures
- 🌐 Multilingual - supports Russian, English and Chinese languages
- ⚡ Works with HTML and PHP files
How to use
- Open HTML or PHP file
- Hover cursor over any class or id attribute
- A tooltip will appear with the selector
- Click on the selector to copy it to clipboard
Example
<div class="header__title">Title</div>
<div id="main-content">Content</div>
When hovering over header__title you will see:
&__title (BEM variation)
.header__title (full selector)
For complex BEM structures like block__element_modifier__subelement , you will see all possible variations:
&__subelement (last BEM section)
&_modifier__subelement (modifier with subelement)
&__element_modifier__subelement (from element level)
.block__element_modifier__subelement (full selector)
When hovering over main-content you will see:
Supported languages
- 🇺🇸 English
- 🇷🇺 Русский
- 🇨🇳 中文 (简体)
Installation
- Download
.vsix file
- In VS Code:
Ctrl+Shift+P → Extensions: Install from VSIX
- Select downloaded file
Requirements
- VS Code version 1.76.0 or higher
Supported files
Enjoy quick CSS selector copying! 🚀
| |