Announcement

Collapse
No announcement yet.

Change commented code color in DWB Custom editor

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Change commented code color in DWB Custom editor

    Is there any way to change commented code from green to gray in the DWB Custom editor for CSS?

    I know this code will work, but I can't figure out where to put it.

    .ace-tm .ace_comment {
    color: #4c886b;
    }

    Of course I tried it in the CSS, but it looks like the theme CSS is not read by the editor.

    The editor has both selectors AND comments as green and it is confusing.

    Any ideas?

    Thanks,



  • #2
    The problem is, I think, that it is CSS that should work in backend, not in frontend. I found this snippet on CSS-Tricks and tried with my skin PHP file, which worked (change color to what you want):

    Code:
    add_action('admin_head', 'custom_ace_css');
    
    function custom_ace_css() {
      echo '<style>
        .ace-tm .ace_comment {
        color: #b2b2b2;
        }
      </style>';
    }
    Source: https://css-tricks.com/snippets/word...to-admin-area/

    Don´t know if that´s the best way to do it - you might rather want to contact support staff with questions like these....
    Last edited by SiGa; 04-16-2017, 06:16 PM.

    Comment


    • #3
      I put it in my functions.php and it did not work. I'm also using a skin. Where is that php file located? I would think it would work with DWB core and not the skin?

      UPDATE: Never mind, I found it. Looks like you have to login as root via FTP to change .... /wp-content/uploads/dynamik-gen/skins/storefront/functions.php

      It works now!

      THANK YOU!
      Last edited by dev77; 04-16-2017, 06:48 PM.

      Comment


      • #4
        Or you would go to Dynamik Design - Skins and just click on the "PHP" button on your skin screenshot..... (note the comments in this file and add your code at the bottom)

        Note: If you don´t see the CSS/PHP/JS buttons on your skin screenshot, you either have an old version of Dynamik OR you´re still working on the default skin. In this case, just type in a new name into the field above and create a new skin, which will copy all of your settings of the currently active skin and this new one will show the buttons then. (There´s a video in the Docs).
        But seeing you´re using Storefront, they should be there. No need to FTP. Unless you prefer.

        You might have to refresh the page after saving, though (and clear any involved caches, just in case).
        Last edited by SiGa; 04-16-2017, 07:58 PM.

        Comment


        • #5
          I didn't know you could access the CSS for the skin... I didn't even know that a skin had its own CSS. What is interesting is that CSS to change something WordPress like making page titles green:

          .dynamik-page-builder .site-inner h1, .content .post h1, .content .page h1, .content h1.entry-title, .content .entry-content h1, body.search .content h1.archive-title {
          color: green;

          }

          will work in both the skin CSS and the regular DWB custom CSS.

          My guess is that if the skin creator entered some special class in his skin that you could only override it via the skin CSS.

          Thanks for the help on this one.

          Last edited by SiGa; 04-17-2017, 09:46 AM.

          Comment


          • SiGa
            SiGa commented
            Editing a comment
            To clarify: What you put into Dynamik Custom tabs is valid for ALL skins. What you put into skin files (CSS/PHP/JS) is valid only for that individual skin. So for CSS that should address only a certain skin, it makes sense to put it into the skin CSS file, so skins with their styles are entirely switchable (just for example).

        • #6
          An easy way to add SiGa's code is to use the Code Snippets plugin Paste it in a new snippet and select "Only run in administration area". Nice thing about this plugin is that if there is an error in the code, it will not activate it, saving one from the dreaded WSOD Tried it and it works great ... red comments!

          Comment


          • #7

            To clarify: What you put into Dynamik Custom tabs is valid for ALL skins. What you put into skin files (CSS/PHP/JS) is valid only for that individual skin. So for CSS that should address only a certain skin, it makes sense to put it into the skin CSS file, so skins with their styles are entirely switchable (just for example)
            Well, I put the code in the DWB Custom tab and it did not work. It did work in the skin PHP.

            Do people have more than one skin per site? Why?

            As for the Code Snippet plugin, thanks for the idea Sniff, but I try to use a few plugins as possible, especially if I can get a result without one, as in this case.

            Comment


            • #8
              Works fine in Dynamik Custom - Functions, too, if you just do this:

              You might have to refresh the page after saving, though (and clear any involved caches, just in case).
              EDIT: Just be sure not to have it in both places as you would likely get errors or a white screen then.

              Do people have more than one skin per site? Why?
              To try different looks and colors and effects. To have different versions at hand. Just like some people do have several themes installed. To play and decide, for training how to use features of Dynamik, to get better, to stay on top of what you can do with it.... and just for fun. Not necessarily on production sites.
              Last edited by SiGa; 04-17-2017, 04:20 PM.

              Comment

              Working...
              X