HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URLs added here will be added as <link>
s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
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.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<link href="https://fonts.googleapis.com/css?family=Baloo+Bhaina|Open+Sans" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Raleway|Slabo+27px|Yatra+One" rel="stylesheet">
<h1 id = "moveCenter"> Using Coding for More Accurate and Inclusive Gender Language in Text</h1>
<div id = "message">
<p>The fear and lack of understanding around gender non-conformity has far too violent and real consequences for those people who are excluded from the popular binary understanding. I wanted to help ease the discomfort that comes along with not understanding, and to show how easily, without any adjustments to the elements of language themselves, we could write, talk, and present our views and the world without making assumptions or exclusions about the gender identities of the people involved. We have the words for this and are choosing not to use them.</p>
<p>Below is a weekly news summary published by the NY Times. Shown in its original language in the smaller font, with the gender words I focused on highlighted in red, the font of which is my attempt at an 'awkward' looking text to match the bumbling, sharp, thoughtless nature of our assumptive, and exclusionary use of pronouns when it comes to signifying gender in our at least national zeitgeist. To the left in larger font is the same NY Times text, but processed through the code I wrote which has attempted to amend the assumptions of the original article while remaining as coherent and understandable in its primary communications.</p>
<div id = "footNote">
<p>*1 I have done this to the best of my ability, but am severely limited by the fact that I am making individual decisions in the coding of this, while language, and language as such, are collective and democratic negotiations, and so my exercise in identifying which words do and do not fall into the category of deserving reform is somewhat in the realm of thought, since I am not speaking from a consensus practice of meaning making and language definition. Secondly, I am limited in that I am still learning how to code well enough to keep up with my mind, so in the distance between these things are some limitations and errors which I have attempted to mark and will continue to amend, and humbly ask that you excuse them at least and perhaps only enough that you are able to investigate and interact with the ideas presented here and view them beyond the limitations of their author. </p>
</div>
</div>
<h1 id = "headLine"> Original</h1>
<div id = "originalThis">
<p id="words"></p>
</div>
<div id = "reCreate">
<h1>Processed</h1>
<p id="return"></p>
</div>
@orange: #FF5A0B;
@red: #FF0000;
@deepRed:#B90504;
@kissRed:#990100;
@cream:#FFF2BC;
@grey:#806F66;
@fiftyShades: #E8E8E8;
@dark:#383636;
@theDarkness: #333333;
@theBlack: #111;
@tufteBack: #fffff8;
@shadyDream: #DEDEDE;
@shadyDark: #2C352F;
@highlightBase:#A41623;
@highlight: lighten(@highlightBase, 10%);
@myFont: 'Yatra One', cursive;
@turk:#1985A1;
@shadyGreen:#B8D8C1;
body {
padding: 20px;
background-color: @shadyDream;
// width: 60%;
// padding-left: 9em;
// padding-riight: 1em;
// font-size: 18px;
font-size: 1em;
color: #2C352F;
font-family: 'Open Sans', sans-serif;
}
a{
color: @turk;
}
#message {
width: 65%;
margin-left: 18%;
}
#footNote{
font-size: 10px;
}
#reCreate{
width: 55%;
// padding-left: 33%;
margin-left: 18px;
position: absolute;
font-size: 16px;
line-height: 1.5;
}
#google{
align: center;
padding-left: 18%;
}
#originalThis {
font-size: 10px;
width: 30%;
position: absolute;
padding-left: 60%;
padding-top: 9%;
margin-left: 10px;
}
#moveCenter{
text-align: center;
}
#headLine{
position:absolute;
left: 66%;
// padding-bottom: 20%;
}
.file {
margin-top: 24px;
font-weight: bold;
}
.text {
border-style: solid;
border-width: 1px;
padding: 20px;
}
#drop_zone {
padding: 20px;
border-style: dotted;
width: 200px;
text-align: center;
}
// #onethey{
// color: #A41623;
// }
// #oneThey{
// color: #A41623;
// }
// #onetheir{
// color: #A41623;
// }
// #onethemselves {
// color: #A41623;
// }
// dealing with tense issue with 'she' to 'they' relates -->related--but it looks funky
#onerelates{
// visibility: hidden;
text-decoration: line-through;
}
#onedaughter{
text-decoration: underline overline;
}
#his{
color: @highlight;
// background-color: #FEFE91;
// font-family: 'Baloo Bhaina', cursive;
font-family: @myFont;
}
#him{
color: @highlight;
// background-color: #FEFE91;
font-family:@myFont;
}
#her{
color: @highlight;
font-family:@myFont;
}
#His{
color: @highlight;
// background-color: #FEFE91;
font-family:@myFont;
}
#Her{
color: @highlight;
font-family:@myFont;
}
#he {
color: @highlight;
font-family:@myFont;
}
#she {
color: @highlight;
font-family:@myFont;
}
#He {
color: @highlight;
font-family:@myFont;
}
#She {
color: @highlight;
font-family:@myFont;
}
#himself{
color: @highlight;
font-family:@myFont;
}
#Mr{
color: @highlight;
font-family:@myFont;
}
#Mrs{
color: @highlight;
font-family:@myFont;
}
// Here is where we are working with a regex
function process(data) {
//create an array of the entire text
var txt = data.join('\n');
//create an array of the text by word (why do I need to data.join above before I can split.text"? @ask)
var showMe = split(txt, ' ');
// console.log(showMe);
// map objects to set word that replaces matched word in for regex below
var mapObj = {
he:"they",
He: "They",
his:"their",
her: "their",
him: "them",
himself: 'themselves',
//need a second one for the her that should be 'them'
She: "They related" //need to erase original 'relates' in the first part I think, like capture ''
};
//regex to find 'gender words' (need to add the rest in between pipes below)
var regex = /(\bhe\b|\bHe\b|\bhim\b|\bhis\b|\bhimself\b|\bher\b|\bShe\b)/gi;
// regex replace using a function as the second argument which returns the mapped object from above to correctly replace each word with its assigned replacement
var results = txt.replace(regex,function(matched){
return mapObj[matched];
});
//displaying the (re)Created text
var reSplit = split(results, ' ');
// console.log(reSplit);
var reWordP = select('#return');
for (var i = 0; i < reSplit.length; i++) {
var thing = createSpan(reSplit[i]);
//assign an id to each span that is = (one)word so that I can distinguish from id = word, which for loop for highlighted original uses
thing.id("one"+reSplit[i]);
thing.parent(reWordP);
//put spaces in between returned words
var space2 = createSpan(" ");
space2.parent(reWordP);
}
//full text
// var par = select('#return');
// par.html(txt);
//for loop to give each word a span element and give the word 'his' an id of 'his' (or append it to an html element which already has the id 'his')
//Displaying the original text with highlighted gender words
var wordP = select('#words');
for (var i = 0; i < showMe.length; i++) {
var word = createSpan(showMe[i]);
//assign an id to each span that is equal to its name so that I can assign css styling to the original gender word
word.id(showMe[i]);
word.parent(wordP);
//put spaces in between returned words
var space = createSpan(" ");
space.parent(wordP);
}
}
var lines;
function preload() {
lines = loadStrings('https://s3-us-west-2.amazonaws.com/s.cdpn.io/255459/gender.txt', process);
}
function setup() {
}
Also see: Tab Triggers