Skip to main content
Inspiring
June 25, 2024
Answered

Listing code alphabetically

  • June 25, 2024
  • 3 replies
  • 813 views

Hi everyone,

 

Is there a way to list your code alphabetically in Dreamweaver? (see below)

 

Thanks.

 

Mark

 

 

Before

.class {
padding: 2px; 
display: block;
list-style: none;
margin: 10px;

font-size: 1rem;

font-color: #000;
}

 

After

.class {
display: block;

font-color: #000;

font-size: 1rem;

list-style: none;

margin: 10px;

padding: 2px; 

}

This topic has been closed for replies.
Correct answer Fun Seeker

OK, thanks Jon. 

3 replies

Community Expert
June 27, 2024

Given my limited English skills, I might have misinterpreted the question, what I understand is that you want to classify properties within a declaration, and not the declarations themselves as @Nancy OShea implies.

 

If we're indeed talking about CSS property sorting, as @Jon Fritz mentioned, Dreamweaver (DW) does not offer this functionality, at least AFAIK. Fortunately, Node.js provides us with a wonderful tool for this purpose.

 

While alphabetical sorting is one option, there are also approaches like SMACSS and concentric sorting, which are often more suitable for intensive coding needs.

To get started, I recommend checking out the following tool: css-declaration-sorter.

 

Inspiring
June 28, 2024

Hi Lena,

 

Yes, I want to classify properties within a declaration. Thanks for the link. 

 

Mark

Nancy OShea
Community Expert
Community Expert
June 26, 2024

Sorting CSS code alphabetically could be catastrophic. Styles cascade downward in order of importance; not alphabetically or numerically.

 

My guess is that you're searching for something in Code View.  Use Ctrl + F or Ctrl+Shift + F for advanced search options.

 

Hope that helps.

 

 

 

 

 

 

 

Nancy O'Shea— Product User & Community Expert
Inspiring
June 28, 2024

Hi Nancy, I don't think I explained myself properly.

 

I wanted to know if there was a quick and easy way to arrange the properties of any given selector in alphabetical order. Similar to how the Apply Source Formatting function works except it would list the selected properties in alphabetical order. Thanks.

Jon Fritz
Community Expert
Community Expert
June 26, 2024

There's nothing in DW to rearrange your css properties alphabetically in your actual code.

Older versions would list set properties of selectors alphabetically in the CSS Panel, but since the introduction of the CSS Designer, that's no longer the case.

Fun SeekerAuthorCorrect answer
Inspiring
June 28, 2024

OK, thanks Jon.