‘nth of type’ conditions for paragraph styles
In CSS, we can use an nth-of-type() selector to define behaviour for the nth instance of a style. For example, we can make all paragraphs have a first line indent, but use nth-of-type(1) to remove the indent from the first paragraph on the page. This feature also supports (odd) and (even) values for n.
This feature would be extremely useful in Indesign for a range of use cases. Importantly, it would eliminate the need for several styles when typesetting multiple-paragraph block quotes, interview dialogue (indenting/outdenting), drop caps on chapter openings, etc.
For full flexibility, I imagine the feature would offer the ability to clarify the extent of the document sampled for the nth of type condition, ie. nth of type within <document>, <story>, <page>, or <contiguous block of paragraphs sharing the same style>.
The feature could be implemented similarly to Nested Styles, except the user would be assigning a paragraph style rather than a character style.
This would be extremely useful in InDesign. I often find myself setting up three paragraph styles — First, Middle, and Last — to adjust spacing above and below lists, quotes, dialogue, etc. Would be much easier to have one paragraph style with 'nth of type' conditions as per CSS.
Similarly, it would be very useful to have conditional styles for 'preceeded by' and 'followed by', a bit like CSS element + element selector. i.e. when you have `body text paragraph style` preceeded by another `body text paragraph style`, apply an indent.