Skip to main content
October 27, 2018
Answered

CSS Variable

  • October 27, 2018
  • 4 replies
  • 4615 views

I have started using CSS variables and Dreamweaver CC ver 19 shows an error saying that it expects a RBRACE at line 4 col 5

1

2    

3     :root{

4         --main-color: #f29829;

5          }

The variable works but I have to keep shutting the page and re-opening to see it in split view

Anybody know what might be going on here?

Ian

    Correct answer Jon Fritz

    ianb76576944  wrote

    Thank you to all who took the time to reply here, I was under the impression the Dreamweaver would have caught up with this by now as variables seem to be quite well established now as are css grids. I might stay away from variables for now as I don’t like red error warnings in my code, even if it does work in the browser.

    Speaking of which the Live Preview is still playing up, to view pages I am still having to rely upon right-clicking the tab and choosing Open in Browser, so the latest update still seems to have overlooked some issues.


    Real Time Preview still doesn't work right in my workflow either, but in CC2019, you can go to Edit > Preferences > Real Time Preview and check the box for "Default to static browser preview" so you can use F12 for Open in Browser instead of using the right click > open in browser menu item.

    4 replies

    Legend
    October 30, 2018

    I use LiveReload along with FIrefox browser extension - I haven't been able to work out why the Dreamweaver's Real-Time Preview works sometimes and then decides to stop playing all of sudden!!

    Paul-M - Community Expert
    B i r n o u
    Legend
    October 30, 2018

    yep, you're right, nothing beats a good old script under nmp to manage the real-time preview... and on all devices simultaneously, not just one

    October 28, 2018

    Thank you to all who took the time to reply here, I was under the impression the Dreamweaver would have caught up with this by now as variables seem to be quite well established now as are css grids. I might stay away from variables for now as I don’t like red error warnings in my code, even if it does work in the browser.

    Speaking of which the Live Preview is still playing up, to view pages I am still having to rely upon right-clicking the tab and choosing Open in Browser, so the latest update still seems to have overlooked some issues.

    Known Participant
    October 28, 2018

    What I should have said in the above post was Real Time Preview doesn't work - keeps telling me I am trying to access an HTML page that can't be viewed on the device??

    ALsp
    Legend
    October 27, 2018

    In addition to Paula's advice, I would be a bit wary of using variables as browser support is still in the experimental stage and syntactical elements could change.

    pziecina
    Legend
    October 27, 2018

    ALsp  wrote

    In addition to Paula's advice, I would be a bit wary of using variables as browser support is still in the experimental stage and syntactical elements could change.

    It's no longer behind a flag in any browser, and very well supported in all modern browsers.

    The only item that one should watch out for, is IE and older device support, but fallback code is well documented, (there is even an extension in VS Code for automatic creation of).

    Note - I would put the warning about using css variables, on par with the use of css grid layouts.

    ALsp
    Legend
    October 28, 2018

    I sort of agree with that :-)

    I have actually spent some time mulling over an extension for CSS variables. Doing fallbacks for pesky IE11 and 10 are a nightmare, though, in an automated setting.

    pziecina
    Legend
    October 27, 2018

    Dreamweavers code editor currently does not support css variables, but live view, (which is a version of Chrome) does.

    Ignore the error message.