Skip to main content
Inspiring
Jun 25, 2024 7:30 PM UTC
Answered

Listing code alphabetically

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 is closed to new replies. Start a new post to keep the conversation going.
Fun SeekerCorrect answer
Inspiring
Jun 28, 2024 10:11 PM UTC

OK, thanks Jon. 

6 replies

Community Expert
Jun 27, 2024 9:01 AM UTC

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.

 

Translate
Inspiring
Jun 28, 2024 10:20 PM UTC

Hi Lena,

 

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

 

Mark

Translate
Nancy OShea
Community Expert
Community Expert
Jun 26, 2024 11:47 PM UTC

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.

 

 

 

 

 

 

 

Translate
Nancy O'Shea— Product User & Community Expert
Inspiring
Jun 28, 2024 10:17 PM UTC

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.

Translate
Jon Fritz
Community Expert
Community Expert
Jun 26, 2024 12:48 PM UTC

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.

Translate
Fun SeekerAuthorCorrect answer
Inspiring
Jun 28, 2024 10:11 PM UTC

OK, thanks Jon. 

Translate