How to display CSS style on a PHP page?



  • Hi.

    I have a PHP page that’s full of CSS and I’m wanting to open the PHP page, yet have the style be CSS so I can read the CSS easily.

    How to do this?

    Thanks.



  • @Jonathan-Nich

    To my knowledge, there is no lexer that contains PHP and CSS.
    What you can try is something I have posted here.
    But I don’t know if this is sufficient in your case.



  • In such cases, I constantly switch the language syntax, and to make it more convenient, I duplicated it in the context menu

    Безымянный.png



  • @Jonathan-Nich ,

    If you want to use @andrecool-68’s suggestion of adding the lexers to the context menu: in case it wasn’t clear, the arrow wasn’t meant to indicate that opening the Languages menu will give the popup in the screenshot – rather, he modified his right-click ContextMenu to include a Syntax Language folder which allows changing to his favorite list of languges. See this discussion, where we delve more deeply into how @andrecool-68 made that folder in the context menu. To make the edits, you will use Settings > Edit Popup ContextMenu to change the settings in contextMenu.xml. See the contextMenu docs here for more on the syntax.

    Alternately, you could set up a script similar to the ones described in this other thread. The post I linked contains a script which toggles between XML and HTML, which could be quickly adapted to work with CSS and PHP. Throughout the thread, there are also examples of using a macro to just set the language instead of toggling, and other similar concepts.


Log in to reply