1. PROMO Subscribe our All Access Pass @ 75% OFF & access all our 16+ premium Divi extensions: Divi Block Pro, Carousel Toolkit, etc.LEARN MORE
Dismiss Notice
NEW Divi.Help Pro Carousel AI Toolkit - Magically turn your Divi design into carousel, simply by using our online toolkit. No plugins needed. Now it works with Divi 5 as well!Try our carousel AI toolkit
BEST Divi Block - A revolutionary drag & drop tool to easily mix & match 960+ premade blocks (Light & Dark) to kick start your Divi site design. Special module designs are included as well. Also newly added AI generator & color. Now it works with Divi 5 as well!
Learn More About Divi BlockFree Version ~ 340+ Free Blocks

Solved css variable syntax error in Divi

Discussion in 'Free Divi Community Forum' started by CactusZeus, Mar 15, 2022.

  1. CactusZeus

    CactusZeus New Member

    Hello,

    Each time I try to declare a variable in Divi custom css panel or page, I get the syntax error "caution this may break your site"

    the syntax (from https://www.w3schools.com/css/css3_variables.asp) :

    :root {
    --blue: #1e90ff;
    --white: #ffffff;
    }

    same error with

    body {
    --blue: #1e90ff;
    --white: #ffffff;
    }

    Something seems to be wrong with "--".

    I did some researches and didn't find any relative topics to variables issues in css with Divi.

    I suppose I'm missing something. Any clue ? Thanx in advance.
     

    Attached Files:

    1. PRO MEMBER PERKS Divi Block Pro - Premade horizontal timeline design for your Divi site without using any plugins:View Demo
  2. Divi.Help

    Divi.Help Administrator
    Staff Member

    You may ignore the error, as it's a valid CSS.

    It's just that the CodeMirror in Wordpress that does the checking is not updated for modern syntax.
     
  3. CactusZeus

    CactusZeus New Member

    That's very helpful.
    Thanks a lot !
     
    1. PRO MEMBER PERKS Divi Block Pro - Premade slide in bar design for your Divi site without using any plugins:View Demo
  4. Jurrie

    Jurrie New Member

    I'm trying to do the same thing, but now in the custom CSS of a page. It shows an error, and the code is deleted. What to do now?