Comments (6)
Would you please tell me the difference between '.html' and '.text.html'?
.html
matches elements with just the html
CSS class, .text.html
matches elements that have both the html
and text
CSS classes.
The snippets system uses the "best match" to determine which snippet to run and ties favor the snippets in ~/.atom/snippets.cson
so you needed to have a selector as specific as the built-in one for it to be properly overridden.
https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_started/Selectors
from snippets.
Does this work?
'.text.html':
'script':
'prefix': 'script'
'body': """
<script>
$1
</script>
"""
from snippets.
That works! Thank you very much! 😁
Would you please tell me the difference between '.html'
and '.text.html'
?
from snippets.
.html matches elements with just the html CSS class, .text.html matches elements that have both the html and text CSS classes.
I know CSS selector, but I do not understand that a file has CSS classes. And I do not know how to get classes of a file?
I guess .html
means the suffix of the file name, but .text
means what?
from snippets.
Atom has a tokenizer that uses TextMate grammars and converts the TextMate scopes to CSS selectors when it creates the DOM elements.
So if you look at the HTML grammar, the root scope name is text.html.basic
meaning that all HTML lines will have the text
, html
, and basic
CSS classes on it.
from snippets.
Thank you for your answer! 👻
from snippets.
Related Issues (20)
- snippet not working without spaces between characters HOT 6
- Documentation: description of finding snippet scope does not work HOT 5
- Implement $0 as a snippet exit point (à la TextMate or Sublime Text) HOT 4
- <unknown> is deprecated. HOT 1
- Replace snippet starting with backslash does not work HOT 3
- Multi-cursor, multi-line snippets have indents eaten when certain characters are input HOT 2
- Loading of Snippets on start up HOT 1
- Make snippets LSP compliant HOT 1
- Project Based Snippets HOT 2
- Add highlighting to non-selected placeholders HOT 1
- Custom snippets added to snippets.cson do not load HOT 3
- Snippets Trigger while Typing in Tab Stops HOT 6
- Snippets with variable HOT 2
- Autocomplet is not working at all for me HOT 6
- Shift Tab Moves Contents Of Buffer
- Snippet not working without space. HOT 1
- Snippets inside snippets HOT 1
- Wrap selection HOT 3
- Failed to load the snippets package
- Failed to load the snippets package
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snippets.