Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <main lang="de">
	<h1>Der Gender&shy;stern für <span title="Screenreader*innen">Screenreader*innen</span></h1>
	<p>Screenreader*innen stehen vor dem Problem, dass jeder Gender&shy;stern als „Stern“ vorgelesen wird, <em>was Nutzer*innen das Verstehen des Inhalts erschwert</em>. <a href="" taraget="_blank">Jan Hellbusch empfielt</a> deshalb, den Gender&shy;stern vor Screenreader*innen zu verstecken und für Screenreader*innen das <span style="white-space: nowrap">Binnen-I</span> zu verwenden.</p>
	<p>Nun ist aber nicht allen Autor*innen zuzumuten, Markup in ihren Editor*innen zu schreiben. Für per <abbr title="Content Management System">CMS</abbr> gepflegte Texte ist eine Lösung gefragt, die das entsprechende Markup automatisch generiert. Dabei müssen Gender&shy;sterne von anderen * unterschieden werden.</p>
	<p>Das Script ersetzt `<code>*in</code>` durch `<code>&lt;span class="genderstar" aria-hidden="true">*&lt;/span>&lt;span aria-hidden="true">in&lt;/span>&lt;span visually-hidden="true">In&lt;/span></code>`; ebenso für `<code>*innen</code>`.</p>

	padding: 0 2em;

	margin: auto;
	max-width: 42em;
	font: 1.2em/1.5 Source Serif Pro, Georgia, serif;
	hyphens: auto;

	font-size: 1.7em;
	line-height: 1.1;
	font-weight: 600;

	position: absolute !important;
	clip: rect(1px, 1px, 1px, 1px) !important;
	padding: 0 !important;
	border: 0 !important;
	height: 1px !important;
	width: 1px !important;
	overflow: hidden !important;
	white-space: nowrap !important;

	color: red;

	font-family: Source Code Pro, monospace;
              HTMLElement.prototype.textTransform = function ()
	const nodeIterator = document.createNodeIterator(this, NodeFilter.SHOW_TEXT);

	let node;

	while (node = nodeIterator.nextNode())
		if (node.textContent && node.textContent.indexOf('*') != -1)
			let parts = node.textContent.split(/\b\*\b/);
			let newNode;

			parts.forEach((part, index) => {
				if (index)
					newNode = document.createElement('span');
					newNode.setAttribute('aria-hidden', 'true')
					newNode.textContent = '*';
					node.parentElement.insertBefore(newNode, node);

					if (part.substr(0, 2) == 'in')
						let isPlural = (part.substr(0, 5) == 'innen');
						newNode = document.createElement('span');
						newNode.setAttribute('aria-hidden', 'true');
						newNode.textContent = isPlural ? 'innen' : 'in';
						node.parentElement.insertBefore(newNode, node);

						newNode = document.createElement('span');
						newNode.setAttribute('visually-hidden', 'true');
						newNode.textContent = isPlural ? 'Innen' : 'In';
						node.parentElement.insertBefore(newNode, node);

						part = part.substr(isPlural ? 5 : 2);

				newNode = document.createTextNode(part);
				node.parentElement.insertBefore(newNode, node);



🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.