Git Product home page Git Product logo

Comments (6)

neurosnap avatar neurosnap commented on August 23, 2024 4

I decided to take a stab at some meager syntax highlighting support for Atom. I'm happy to announce it was easier than anticipated.

This Atom package basically provides default javascript support with css syntax highlighting for anything inside the tagged string template csjs``.

Lemme know what you think!

https://github.com/neurosnap/language-csjs
https://atom.io/packages/language-csjs

It was really easy to include syntax highlighting from other languages in Atom, so this package could be use for other template strings pretty easily.

from csjs.

neurosnap avatar neurosnap commented on August 23, 2024 1

I wanted to also add that I managed to get autocomplete support for CSJS files in Atom as well. It is a separate package:

Syntax highlighting works with javascript expressions now as well:

To clarify, this will only work when the language selected for the file is CSJS.

from csjs.

colejd avatar colejd commented on August 23, 2024 1

I ported @neurosnap's syntax highlighter to VS Code:

https://github.com/colejd/vscode-language-csjs

It's not totally done yet -- it seems that for highlighting JS-in-CSS-in-JS using a TextMate grammar like VS Code or Atom does, you basically need to copy the entire CSS grammar and figure out the places where a ${} block might appear. If anyone knowledgeable about TextMate grammars stumbles on this, I'd really appreciate some help!

from csjs.

rtsao avatar rtsao commented on August 23, 2024

@scott113341 posted a cool way to get CSS syntax highlighting with WebStorm/IntelliJ IDE:
#28 (comment)

Other than that, it'd be cool for some generic way to get syntax highlighting within template strings. For example HTML syntax highlighting with https://github.com/substack/hyperx or CSS within CSJS. But at this time I'm not aware of any way to do that in editors other than IntelliJ.

from csjs.

rtsao avatar rtsao commented on August 23, 2024

Wow, that is super awesome! I'll have to try it out (and add it to the docs)

from csjs.

felipeccastro avatar felipeccastro commented on August 23, 2024

I've noticed that Atom, by default (using dark theme), will use the css syntax if the tag method is called css, instead of csjs. Unfortunately, even if I create an alias in my code, some plugins (like the babel-plugin-csjs-postcss) are counting on the tag being named csjs.
Is there an easier way to handle this besides forking the plugin?

from csjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.