Added info about region comments (#21757)
This commit is contained in:
committed by
Christopher McCormack
parent
96c4166b52
commit
bc4ff23fa8
@ -101,6 +101,28 @@ h2 {
|
|||||||
|
|
||||||
Tip: Many code editors will comment a highlighted portion of text by typing `CMD + /` (Mac) or `CTRL + /` (Windows).
|
Tip: Many code editors will comment a highlighted portion of text by typing `CMD + /` (Mac) or `CTRL + /` (Windows).
|
||||||
|
|
||||||
|
The best thing you can do in CSS with comments is the next thing: use Regions. Yes, the regions you use too in C#.
|
||||||
|
Regions are useful in a long CSS file, when you've got plenty of classes and sections to manage and organize. They are basically commented titles of specific sections. The best part about regions? You can collapse/expand them.
|
||||||
|
|
||||||
|
Here's how region works:
|
||||||
|
``` css
|
||||||
|
/*#region Header */
|
||||||
|
|
||||||
|
.header {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*#endregion */
|
||||||
|
|
||||||
|
/*#region Footer
|
||||||
|
------------------------------------------- */
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
/*#endregion */
|
||||||
|
````
|
||||||
|
|
||||||
### More Information:
|
### More Information:
|
||||||
|
|
||||||
* [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/CSS/Comments)
|
* [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/CSS/Comments)
|
||||||
|
Reference in New Issue
Block a user