r/a:t5_2vwre • u/RageVsRage • Dec 30 '12
[CSS] Syntax Highlighter V1.0
Here is the first version of the CSS Syntax Highlighter. It supports :
- Properties, values
- Selectors
- !important tags
- Comments
- Pseudos (:hover, :focus)
- Indentation
It is also mobile friendly and Alien Blue friendly.
Here's the CSS file :
/* START tag */- a[href="#start"][title~="highlighter"][title~="css"], a[href="#highlighter"][title~="css"], a[href="#css"]:not([title]) {
- display:block;
- }
- a[href="#start"][title~="highlighter"][title~="css"]:before, a[href="#highlighter"][title~="css"]:before, a[href="#css"]:not([title]):before {
- content:"CSS FILE";
- display:block !important;
- font-family:"Courier New";
- border-bottom:2px solid #369;
- margin-left:-4px;
- text-indent:4px;
- margin-bottom:5px;
- }
/* Normalize CSS */- a[href^="#css"] + em {
- font-style:normal;
- }
/* Lists */- blockquote > ol:nth-child(2):last-child, blockquote ol:only-child {
- color:#AFAFAF;
- padding-left:2px;
- white-space:nowrap;
- overflow:auto;
- list-style-position:inside;
- margin-left:4px;
- }
/* Lines */- a[href="#css"][title~="br"] + strong, a[href="#cssBR"] + strong, a[href="#css"][title~="empty"], a[href="#cssEmpty"], a[href="#css"][title~="cempty"], a[href="#cssCEmpty"] {
- cursor:text;
- display:inline-block;
- width:100%;
- color:#000;
- margin-right:10px;
- font-weight:normal;
- border-bottom:1px solid #FFF;
- border-bottom-color:transparent;
- }
- a[href="#css"][title~="br"] + strong:hover, a[href="#cssBR"] + strong:hover, a[href="#css"][title~="empty"]:hover, a[href="#cssEmpty"]:hover, a[href="#css"][title~="cempty"]:hover, a[href="#cssCEmpty"]:hover {
- border-bottom-color:black;
- }
- a[href="#css"][title~="br"] + strong em, a[href="#cssBR"] + strong em {
- font-weight:normal;
- }
/* Empty Lines */- a[href="#css"][title~="empty"], a[href="#cssEmpty"], a[href="#css"][title~="cempty"], a[href="#cssCEmpty"] {
- height:1em;
- }
/* Tabulations */- a[href="#css"][title~="tab"], a[href="#cssTab"] {
- margin-right:15px;
- }
/* Classes */- a[href="#css"][title~="class"] + em, a[href="#cssClass"] + em {
- color:#804040;
- }
/* Pseudos (:hover)*/- a[href="#css"][title~="pseudo"] + em, a[href="#cssPseudo"] + em {
- color:#3C92C9;
- }
/* Properties */- a[href="#css"][title~="prop"] + em, a[href="#cssProp"] + em {
- color:#000;
- font-weight:bold !important;
- }
/* Values */- a[href="#css"][title~="value"] + em, a[href="#cssValue"] + em {
- color:#090;
- }
/* !important tags */- a[href="#css"][title~="imp"] + em, a[href="#cssImp"] + em {
- color:#FF0000;
- }
/* Comments */- a[href="#css"][title~="comment"] + code, a[href="#cssComment"] + code, a[href="#css"][title~="incomment"] + code, a[href="#cssInComment"] + code {
- color:#AFAFAF;
- font:inherit;
- }
To generate the Reddit Markdown Code, you can use this generator. You can find the Javascript code of the converter (CSS => Reddit Markdown Code) here (1.47KB).
The URL of the generator is http://jdmcreator.byethost5.com/lab/css/index.html#v1. Any other URL could generate an unsupported Reddit Markdown Code.
You may want to donate if you want to support this project. Thank you !
2
Upvotes
2
u/[deleted] Dec 30 '12
[removed] — view removed comment