Skip to main content
Okoth1
Inspiring
November 8, 2016
Answered

css Apply Source Formatting DW 2017

  • November 8, 2016
  • 16 replies
  • 26261 views

In DW 2015 I used to be able to format the css code by pressing the Apply Source Formatting button. Each property will end up on one line after the tag.

How can I do this in DW 2017?

So from

.entry p {

  line-height: 180%;

  margin: 5px 0;

  padding: 5px 0

}

to

.entry p { line-height: 180%; margin: 5px 0; padding: 5px 0 }

Correct answer Preran

In Dreamweaver 2015 I did this to set the css code preferences. And when I pressed the Apply Source Formatting I got all properties nicely behind the ID or class tag on the same line. So, no hard enter after the semicolon.

DW 2015: Set CSS code formatting preferences

  • Select Edit > Preferences.

  • In the Preferences dialog box, select the Code Format category.

  • Next to Advanced Formatting, click the CSS button.

  • In the CSS Source Format Options dialog box, select the options that you want to apply to your CSS source code. A preview of the CSS as it would look according to the options you’ve selected appears in the Preview window below.

    Indent Properties WithSets the indentation value for properties within a rule. You can specify tabs or spaces.

    Each Property On A Separate LinePlaces each property within a rule on a separate line.

    Opening Brace On Separate LinePlaces the opening brace for a rule on a separate line from the selector.

    Only If More Than One PropertyPlaces single-property rules on the same line as the selector.

    All Selectors For A Rule On Same LinePlaces all selectors for the rule on the same line.

    Blank Line Between RulesInserts a blank line between each rule.

  • Click OK.


Hi Okoth,

This feature has been deprecated in DW CC 2017.

Thanks,

Preran

16 replies

Known Participant
December 29, 2016

Also, what's up with the tag highlighting defaulting to light green with white text??? Really. I was tossed into this 30 min coding challenge and it reset all my formatting settings. The auto indent after hitting enter is ridiculous. Selecting a tag and then not being able to read it is silly... it's not effective or usable and in the end extremely bad UX in my case.

Why in the world lose user's settings in the first place???

Nancy OShea
Community Expert
Community Expert
December 29, 2016

what's up with the tag highlighting defaulting to light green with white text???

Yeah, an unfortunate color choice.   You can change code color Themes or edit the Light Theme LESS file in DW.

Learn how you can customize the colors of your code elements in Dreamweaver.

Nancy

Nancy O'Shea— Product User & Community Expert
Known Participant
December 29, 2016

Deprecated??? What?  Where is the Product Manager here. Are you kidding me?

I updated to the latest sub-version of DW 2017 this morning right before a coding test and it about killed me. You can't be serious that this is a use case -- half the developers I know put CSS attributes on separate lines. 

If I lose this job opportunity because of this I am going to pretty mad.

Participant
December 8, 2016

Losing the ability to format CSS how I need is particularly frustrating for me as an html email developer (embedded CSS).

I - like many - have Dreamweaver on 2 Macs - office and home - both of which now "apply source formatting" entirely differently from each other - as they have each inherited the (configurable) settings from the previous version of DW.

Unfortunately - at the point of upgrading - my settings were very different on the 2 machines - and now we've lost the ability to configure them easily - I'm stuck that way, making DW rather frustrating.

I suppose I could remove the Adobe suite entirely and reinstall to get a "factory" re-set... but then I'm still stuck with my CSS formatting as Adobe think it should. Not cool.

whamalamaboom
Inspiring
November 23, 2016

I just signed in to ask about this.  noticed after I upgraded that apply source formatting wasn't working anymore. Now I know why. Sucks when useful things get removed. Ah well. In the meantime, for anyone interested, I like to use things like www.cleancss.com/css-beautify/ as well.

Participant
November 18, 2016

Yeah, I got so frustrated with this formatting problem that I quit using Dreamweaver for the time being and just switched to a text editor... and was pleasantly surprised by how much better/smoother/quicker it is, even though I do like the visual editing at times. Oh well, it'll be nice if they bring it back, but for now just skipping it for css isn't as bad as I expected.

BenPleysier
Community Expert
Community Expert
November 8, 2016

Edit > Code > Apply Source Formatting

To make it easier, you can apply a Keyboard Shortcut

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Okoth1
Okoth1Author
Inspiring
November 8, 2016

Sorry, Ben, but that doesn't answer my question. See the example format in my question.

You have just explained to me where to find The Apply Source Format, but I already know that. I am looking for a way to customize that format to all properties on one line. This was possible in DW 2015 but it looks like not any more in DW 2017.

Okoth1
Okoth1Author
Inspiring
November 8, 2016

In Dreamweaver 2015 I did this to set the css code preferences. And when I pressed the Apply Source Formatting I got all properties nicely behind the ID or class tag on the same line. So, no hard enter after the semicolon.

DW 2015: Set CSS code formatting preferences

  • Select Edit > Preferences.

  • In the Preferences dialog box, select the Code Format category.

  • Next to Advanced Formatting, click the CSS button.

  • In the CSS Source Format Options dialog box, select the options that you want to apply to your CSS source code. A preview of the CSS as it would look according to the options you’ve selected appears in the Preview window below.

    Indent Properties WithSets the indentation value for properties within a rule. You can specify tabs or spaces.

    Each Property On A Separate LinePlaces each property within a rule on a separate line.

    Opening Brace On Separate LinePlaces the opening brace for a rule on a separate line from the selector.

    Only If More Than One PropertyPlaces single-property rules on the same line as the selector.

    All Selectors For A Rule On Same LinePlaces all selectors for the rule on the same line.

    Blank Line Between RulesInserts a blank line between each rule.

  • Click OK.