-
-
Save felipecrv/2657477 to your computer and use it in GitHub Desktop.
CSS for ctags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--langdef=css \ | |
--langmap=css:.css \ | |
--regex-css='/^[ \t]*\.([A-Za-z0-9_-]+)/#\1/c,class,classes/' \ | |
--regex-css='/^[ \t]*#([A-Za-z0-9_-]+)/.\1/i,id,ids/' \ | |
--regex-css='/^[ \t]*(([A-Za-z0-9_-]+[ \t\n,]+)+)\{/\1/t,tag,tags/' \ | |
--regex-css='/^[ \t]*@media\s+([A-Za-z0-9_-]+)/\1/m,media,medias/' \ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tried to include your CSS regex with a modified version of Ctags -> https://github.com/fishman/ctags
the only missing filter in the modded Ctags version above is Media Queries so I tried with your regex but:
your regex just filter the FIRST AND ONLY THE FIRST WORD of the media query string.
for instance I have this media query:
@media only screen and (min-device-width : 768px)
but your regex filter just the FIRST word after @media -> in this case "only".
so what I get is a list of "only" and "screen" under media queries instead of something more useful such as:
"only screen and (min-device-width: 768px)"
I'm not a good regex writer, otherwise I would modify it by myself: would you please help me fix this?
many thanks!