A Project of the Center for Advanced Study in the Visual Arts, National Gallery of Art
History of Early American Landscape Design

MediaWiki:Enumeration.css

[http://www.nga.gov/content/ngaweb/research/casva/research-projects.html A Project of the National Gallery of Art, Center for Advanced Study in the Visual Arts ]
Revision as of 19:18, June 23, 2021 by I-Hecht (talk | contribs) (Created page with " /** * ### Inline formatting of a series of elements ### * * Wrap a series of elements of class 'enum-el' in a span with class: * - 'enum-series': comma separated list of...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
	/**
	* ### Inline formatting of a series of elements ###
	*
	* Wrap a series of elements of class 'enum-el' in a span with class:
	* - 'enum-series': comma separated list of elements, "and" before the last element 
	* - 'enum-series or': comma separated list of elements, "or" before the last element 
	* - 'enum-series semicolon': semicolon separated list of elements, "and" before the last element 
	* - 'enum-series semicolon or': semicolon separated list of elements, "or" before the last element 
	* The above methods add delimiters visually. 
	*
	* To have a real delimiter, use something like that:
	* <span class="delimiter-series"><span class="delimited-el">element<span class="delimiter">; </span></span> ... </span>
	* The CSS rule will just hide the delimiter after the last element.
	*
	*/

	.enum-series .enum-el::after {
		content: ',\00a0';
	}
	.enum-series.semicolon .enum-el::after {
		content: ';\00a0';
	}
	.enum-series .enum-el:last-of-type::after, .enum-series .enum-el:nth-last-child(2)::after {
		content: '';
	}
	.enum-series .enum-el:last-of-type::before {
		content: '\00a0 and \00a0';
	}
	.enum-series .enum-el:first-of-type::before {
		content: '' !important;
	}
	.enum-series.or .enum-el:last-of-type::before {
		content: '\00a0 or \00a0';
	}
	.enum-series.semicolon .enum-el:last-of-type::before {
		content: ';\00a0';
	}
	
	.delimited-series .delimited-el:last-of-type .delimiter {
		display: none;
	}

Retrieved from "https://heald.nga.gov/mediawiki/index.php?title=MediaWiki:Enumeration.css&oldid=40964"

History of Early American Landscape Design contributors, "MediaWiki:Enumeration.css," History of Early American Landscape Design, , https://heald.nga.gov/mediawiki/index.php?title=MediaWiki:Enumeration.css&oldid=40964 (accessed November 22, 2024).

A Project of the Center for Advanced Study in the Visual Arts

National Gallery of Art, Washington