- eCSStractor for VSCode
- eCSStractor for VSCode README
- Usage
- Settings
- Notes
- class-extractor README
- Install
- Usage
- Requirements
- Development
- Future Plans
- Release Notes
- 1.1.1
- 1.1.0
- 1.0.4
- 1.0.3
- 1.0.1
- 1.0.0
- Thanks
- Как копировать все классы в vs code
- eCSStractor — быстрое копирование CSS классов из HTML
- eCSStractor for VSCode README
- Usage
- Быстрое копирование CSS классов из HTML разметки. Плагин eCSStractor для VS Code
eCSStractor for VSCode
eCSStractor for VSCode README
Usage
- Press Cmd+Shift+P on Mac OS X or Ctrl+Shift+P on Windows/Linux to launch command palette and choose:
- eCSStractor Run
- eCSStractor Run (With BEM Nesting)
- eCSStractor Run (With BEM Nesting and comments)
- eCSStractor Run (Without BEM Nesting)
Then you will see new tab with CSS selectors extracted from document or copy them to the clipboard (depending on settings).
Plugin can process either selected text or whole file.
Settings
- Brackets — Add brackets. Useful for Sass syntax and Stylus
- Brackets newline after — Add new line
- Destination — Where to put result («tab» or «clipboard»)
- Bem nesting — BEM Nesting. Generate nested stylesheet for preprocessors
- Indentation — Indent symbol
- Element separator — Separator between block and element names
- Modifier separator — Separator between block or element and they modifier
- Parent symbol — Parent symbol. Ex.: &__element <>
- Empty line before nested selector — Empty line before nested element/modifier
- Add comment — Add comments to nested stylesheets for preprocessors
- Comment style — Comment style. Either CSS (/* */) or SCSS (//)
Notes
class-extractor README
Extracts CSS classes from a selection of markup and formats it into a useable list to paste into your CSS/LESS/SASS/whatever. Uses htmlparser2 so should be reasonably good at finding the right stuff.
Install
Usage
Class Extractor adds two commands, Extract CSS classes from HTML and Extract LESS/SCSS BEM classes from HTML . Select some HTML markup, run either command (I recommend mapping your preferred option to something like Ctrl + Alt + X ) and the CSS classes are added to your clipboard in the order they appear with no duplicates. The output format by default is [className] < >, however this is configurable in the settings. The LESS/SCSS BEM option will automatically indent. It’s recommended to edit your output format in the JSON settings editor as the VS Code interface doesn’t render newlines and will escape backslash characters.
Requirements
Development
Future Plans
- [ ] Proper unit testing & code restructure to allow proper unit testing
- [x] Indentation in class structure to match existing markup. Makes BEM work a little better
- [ ] Automatically indent based on file or workspace preferences
- [ ] Get indentation working better with incorrect BEM structure
- [ ] Option for BEM sorting but without nesting classes
Release Notes
1.1.1
Fixed default output format
1.1.0
Rewrote BEM option and allowed for custom output templating
1.0.4
Added BEM option for indented languages like LESS and SCSS thanks to @LuisReinoso
1.0.3
Added some install and usage documentation and fixed dependency vulnerabilities
1.0.1
Many minor fixes. Tags with no attributes, empty classes and things other than tags (script blocks, comments etc. ) will now be properly ignored
1.0.0
Thanks
Special thanks to ardcore for this Atom plugin from which this extension draws its origins.
Как копировать все классы в vs code
Подскажите, как копировать все имена классов HTML страницы в редакторе VSC? Это необходимо, чтобы закинуть в CSS файл и приступить к стилизации без написания классов.
Единственный вариант — написать свой плагин для VSC, который бы генерировал файл с кучей названий классов из html документа. Но зачем? Эту кучу еще разгребать, быстрее будет классы вручную писать, да и некоторые, возможно, не пригодятся вовсе.
eCSStractor — быстрое копирование CSS классов из HTML
Увеличить скорость верстки веб-страницы можно достаточно просто. Для этого необходимо скачать и настроить плагин eCSStractor для VSCode. Он позволяет скопировать все ваши классы и легко перенести их из HTML в CSS. Это позволит избежать ошибок и сохранить последовательность и вложенность классов.
При верстке сайтов мы давно используем eCSStractor — полезный плагин, ускоряющий разработку в разы. Зачем переписывать классы вручную, если за вас это может сделать плагин?
Чтобы установить eCSStractor, нужно в поиске MARKETPLACE VSCode ввести название и выбрать нужный плагин. В нашем случае полное название плагина eCSStractor for VSCode, его и устанавливаем:
В настройках плагина все достаточно просто. Самым главным пунктом является:
Здесь нужно выбрать clipboard, для копирования стилей в буфер обмена. Остальные настройки зависят от стиля верстки. Можно использовать БЭМ, можно оставлять комментарии к каждму классу и т.д.
Во время верстки мы поступаем просто. Прописываем структуру блока и нажатием правой кнопки мыши вызываем меню:
Далее просто вставляем код из буфера обмена в ваш CSS или SCSS файл.
С настройками, которые мы установили в eCSStractor, на выходе получили вот такой SCSS код, что упрощает верстку во много раз.
Иногда случается что на Linux eCSStractor не может скопировать (не копирует) код в буфер обмена. Так как в плагине используется api редактора для копирования в буфер обмена, а в линукс 2 буфера обмена clipboard и primary. Решается этот вопрос достаточно просто:
eCSStractor for VSCode README
VSCode plugin for extracting class names from HTML and generate CSS stylesheet for following work.
Usage
Open any document contain HTML and do one of the following:
- Press Cmd+Shift+P on Mac OS X or Ctrl+Shift+P on Windows/Linux to launch command palette and choose:
- eCSStractor Run
- eCSStractor Run (With BEM Nesting)
- eCSStractor Run (With BEM Nesting and comments)
- eCSStractor Run (Without BEM Nesting)
Then you will see new tab with CSS selectors extracted from document or copy them to the clipboard (depending on settings).
Быстрое копирование CSS классов из HTML разметки. Плагин eCSStractor для VS Code
Плагин eCSStractor для VS Code поможет быстро скопировать CSS классы из HTML разметки. Можно использовать горячие клавиши. Как настроить — рассказываю в этом видео.