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 esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM 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.
<div class="container">
<!-- inline svg, sorry don't have a pro account -->
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="960px" height="301px" viewBox="0 0 960 301" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
<title>suzy</title>
<description>I drew this with Sketch :) </description>
<defs></defs>
<g id="a-big-mess-of-paths" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
<rect id="Rectangle-1" stroke="#C5E09F" fill-opacity="0.402860754" fill="#C5E09F" sketch:type="MSShapeGroup" x="0" y="0" width="960" height="301"></rect>
<path d="M959,201.429093 L959,38.2729145 C959,38.2729145 895.746487,64.2340024 877.802093,80.399916 C859.857699,96.5658293 852.659909,96.4677162 852.659909,96.4677162 C852.659909,96.4677162 849.763869,67.7746015 844.733361,55.1096977 C839.702852,42.4447944 827.863109,25 827.863109,25 L818.80543,72.1310663 C818.80543,72.1310663 814.087493,57.598202 805.546162,47.9355584 C797.004831,38.2729148 779.74775,29.4132662 779.74775,29.4132662 C779.74775,29.4132662 775.910541,40.6254407 780.804623,55.4143577 C785.698705,70.2032746 806.6393,102.514442 806.6393,102.514442 L754.648739,164.453359 C754.648739,164.453359 753.845723,171.797901 751.597277,171.797901 C749.348831,171.797901 737.795757,166.96293 732.939666,179.106297 C728.083576,191.249664 732.78079,199.990135 742.189033,199.990134 C751.597277,199.990134 828.096243,162.568598 828.096243,162.568598 C828.096243,162.568598 859.472599,190.401091 863.850331,201.344752 C868.228064,212.288413 868.497466,234.836692 857.75086,246.160747 C847.004255,257.484803 846.064814,263.337028 846.064814,263.337028 L848.366794,265.343997 C848.366794,265.343997 860.071838,261.903232 865.138611,256.737783 C870.205384,251.572334 875.025211,247.532578 875.025211,247.532578 C875.025211,247.532578 872.863112,255.166289 875.332602,257.558816 C877.802092,259.951343 880.841467,260.123468 880.841467,260.123468 C880.841467,260.123468 888.690306,246.179681 888.690304,237.513224 C888.690303,228.846767 889.512317,192.829765 889.512317,192.829765 C889.512317,192.829765 890.797144,184.791562 894.751783,190.39937 C898.706421,196.007179 913.255699,217.276574 910.95199,225.619437 C908.648282,233.962301 900.492056,250.493115 895.002186,256.915071 C889.512315,263.337028 888.303475,271 888.303475,271 C888.303475,271 900.319364,270.502561 906.596706,263.708816 C912.874047,256.915071 916.115472,254.29534 916.115472,254.29534 C916.115472,254.29534 917.633433,265.123678 917.633432,265.123678 C917.633431,265.123678 924.466842,265.870697 924.466842,265.870697 C924.466842,265.870697 930.60776,241.466919 930.607759,226.256297 C930.607757,211.045676 935.981924,193.637028 935.981924,193.637028 L959,201.429093 Z" id="aadvarks-ate-the-js" fill="#B3C993" sketch:type="MSShapeGroup"></path>
<g id="Suzy-logo" sketch:type="MSLayerGroup" transform="translate(30.000000, 24.000000)" fill="#83946B">
<path d="M401.381108,0.164040339 C401.381108,0.164040339 385.746949,8.62213056 380.199514,8.62213056 C374.652079,8.62213056 350.451299,-1.20889969 334.242129,0.124299312 C318.032959,1.45749828 272.234712,16.9857453 272.234715,68.6325806 C272.234721,120.279416 320.228289,131.868051 348.316025,140.76854 C376.403762,149.669027 417.000256,161.763044 402.644482,209.711726 C388.288711,257.660408 331.555489,235.304956 313.233189,223.436635 C294.910889,211.568313 274.553528,182.63084 274.553528,182.63084 L263,188.297311 L287.492039,254.842536 C287.492039,254.842536 302.424323,243.994727 310.641884,242.392347 C318.859444,240.789967 333.490711,254.999994 358.726661,255 C383.962612,255.000009 412.809276,238.62444 422.278199,218.959388 C426.356201,210.490198 434.123264,189.805194 431.453612,171.01596 C427.92446,146.177499 408.314113,121.9765 385.019552,114.197539 C368.011376,108.517844 346.288846,104.470735 325.125269,96.0553914 C303.961691,87.6400471 299.829264,73.5334767 298.357956,65.7757283 C296.886646,58.0179801 294.917644,42.125315 308.127147,28.5796243 C321.336648,15.0339326 343.595451,9.70188449 370.695309,26.409614 C397.795168,43.1173413 412.980427,71.0005459 412.980427,71.0005459 L424.397334,63.7946756 L401.381108,0.164040339 Z" id="Path-1" sketch:type="MSShapeGroup"></path>
<path d="M592,81.3835127 C592,81.3835127 598.14191,77.0000002 598.17626,77 C618.208967,99.3305029 642,120.160507 642,120.160507 L642,123.867132 C642,123.867132 607.511963,153.601052 598.14191,165 L592,160.30111 C601.16612,141.396106 619.882404,120.160507 619.882404,120.160507 C619.882404,120.160507 594.479913,93.8654818 592,81.3835127 Z" id="Path-2" sketch:type="MSShapeGroup"></path>
<path d="M2.71661251e-15,81.3835127 C1.95731122e-09,81.3835127 6.14190951,77.0000002 6.17625974,77 C26.2089668,99.3305029 50,120.160507 50,120.160507 L50,123.867132 C50,123.867132 15.5119627,153.601052 6.14190985,165 L2.71661251e-15,160.30111 C9.16612002,141.396106 27.8824039,120.160507 27.8824039,120.160507 C27.8824039,120.160507 2.47991278,93.8654818 2.71661251e-15,81.3835127 Z" id="Path-2" sketch:type="MSShapeGroup" transform="translate(25.000000, 121.000000) scale(-1, 1) translate(-25.000000, -121.000000) "></path>
</g>
<g id="lines" sketch:type="MSLayerGroup" transform="translate(71.000000, 94.000000)" fill="#BAC8A6">
<rect id="Rectangle-2" sketch:type="MSShapeGroup" transform="translate(8.572832, 47.648989) rotate(-12.000000) translate(-8.572832, -47.648989) " x="0.572832168" y="42.6489892" width="16.3779464" height="10"></rect>
<rect id="Rectangle-2" sketch:type="MSShapeGroup" transform="translate(34.572832, 39.648989) rotate(-22.000000) translate(-34.572832, -39.648989) " x="26.5728322" y="34.6489892" width="16.3779464" height="10"></rect>
<rect id="Rectangle-2" sketch:type="MSShapeGroup" transform="translate(58.226152, 26.687075) rotate(327.000000) translate(-58.226152, -26.687075) " x="50.2261525" y="21.6870751" width="16.3779464" height="10"></rect>
<rect id="Rectangle-2" sketch:type="MSShapeGroup" transform="translate(83.322832, 13.747622) rotate(335.000000) translate(-83.322832, -13.747622) " x="75.3228322" y="8.747622" width="16.3779464" height="10"></rect>
<rect id="Rectangle-2" sketch:type="MSShapeGroup" transform="translate(109.645098, 5.715395) rotate(353.000000) translate(-109.645098, -5.715395) " x="101.645098" y="0.715395438" width="16.3779464" height="10"></rect>
<rect id="Rectangle-2" sketch:type="MSShapeGroup" transform="translate(138.586504, 5.725161) rotate(7.000000) translate(-138.586504, -5.725161) " x="130.586504" y="0.725161063" width="16.3779464" height="10"></rect>
<rect id="Rectangle-2" sketch:type="MSShapeGroup" transform="translate(164.943926, 12.261294) rotate(21.000000) translate(-164.943926, -12.261294) " x="156.943926" y="7.26129388" width="16.3779464" height="10"></rect>
<rect id="Rectangle-2" sketch:type="MSShapeGroup" transform="translate(190.099443, 23.660708) rotate(28.000000) translate(-190.099443, -23.660708) " x="182.099443" y="18.6607079" width="16.3779464" height="10"></rect>
<rect id="Rectangle-2" sketch:type="MSShapeGroup" transform="translate(215.099443, 34.660708) rotate(22.000000) translate(-215.099443, -34.660708) " x="207.099443" y="29.6607079" width="16.3779464" height="10"></rect>
</g>
<g id="lines" sketch:type="MSLayerGroup" transform="translate(480.000000, 139.000000)" fill="#B3C993">
<rect id="Rectangle-2" sketch:type="MSShapeGroup" transform="translate(147.041826, 6.062500) rotate(-11.000000) translate(-147.041826, -6.062500) " x="139.041826" y="1.0625" width="16.3779464" height="10"></rect>
<rect id="Rectangle-2" sketch:type="MSShapeGroup" transform="translate(123.041826, 12.062500) rotate(-17.000000) translate(-123.041826, -12.062500) " x="115.041826" y="7.0625" width="16.3779464" height="10"></rect>
<rect id="Rectangle-2" sketch:type="MSShapeGroup" transform="translate(99.517842, 21.288086) rotate(-28.000000) translate(-99.517842, -21.288086) " x="91.5178417" y="16.2880859" width="16.3779464" height="10"></rect>
<rect id="Rectangle-2" sketch:type="MSShapeGroup" transform="translate(77.952412, 33.698242) rotate(-34.000000) translate(-77.952412, -33.698242) " x="69.952412" y="28.6982422" width="16.3779464" height="10"></rect>
<rect id="Rectangle-2" sketch:type="MSShapeGroup" transform="translate(56.518818, 44.300781) rotate(-23.000000) translate(-56.518818, -44.300781) " x="48.5188182" y="39.3007813" width="16.3779464" height="10"></rect>
<rect id="Rectangle-2" sketch:type="MSShapeGroup" transform="translate(32.424092, 51.189453) rotate(-8.000000) translate(-32.424092, -51.189453) " x="24.4240917" y="46.1894531" width="16.3779464" height="10"></rect>
<rect id="Rectangle-2" sketch:type="MSShapeGroup" transform="translate(8.171628, 52.613281) rotate(1.000000) translate(-8.171628, -52.613281) " x="0.17162764" y="47.6132813" width="16.3779464" height="10"></rect>
</g>
<path d="M499.52,259 C499.424,258.087995 499.364,257.188004 499.34,256.3 C499.316,255.411996 499.304,254.512005 499.304,253.6 L499.16,253.6 C498.631997,254.512005 497.960004,255.351996 497.144,256.12 C496.327996,256.888004 495.416005,257.547997 494.408,258.1 C493.399995,258.652003 492.332006,259.083998 491.204,259.396 C490.075994,259.708002 488.960006,259.864 487.856,259.864 C483.535978,259.864 480.34401,258.724011 478.28,256.444 C476.21599,254.163989 475.184,250.912021 475.184,246.688 L475.184,225.304 L479.936,225.304 L479.936,243.952 C479.936,245.824009 480.079999,247.479993 480.368,248.92 C480.656001,250.360007 481.147997,251.571995 481.844,252.556 C482.540003,253.540005 483.475994,254.283997 484.652,254.788 C485.828006,255.292003 487.303991,255.544 489.08,255.544 C489.320001,255.544 489.991994,255.448001 491.096,255.256 C492.200006,255.063999 493.363994,254.536004 494.588,253.672 C495.812006,252.807996 496.903995,251.512009 497.864,249.784 C498.824005,248.055991 499.304,245.656015 499.304,242.584 L499.304,225.304 L504.056,225.304 L504.056,251.584 C504.056,252.496005 504.092,253.647993 504.164,255.04 C504.236,256.432007 504.32,257.751994 504.416,259 L499.52,259 Z M533.072,233.296 C532.351996,231.903993 531.392006,230.800004 530.192,229.984 C528.991994,229.167996 527.528009,228.76 525.8,228.76 C524.983996,228.76 524.156004,228.855999 523.316,229.048 C522.475996,229.240001 521.720003,229.539998 521.048,229.948 C520.375997,230.356002 519.836002,230.871997 519.428,231.496 C519.019998,232.120003 518.816,232.887995 518.816,233.8 C518.816,235.384008 519.367994,236.535996 520.472,237.256 C521.576006,237.976004 523.231989,238.599997 525.44,239.128 L530.264,240.28 C532.616012,240.808003 534.571992,241.875992 536.132,243.484 C537.692008,245.092008 538.472,247.095988 538.472,249.496 C538.472,251.320009 538.100004,252.891993 537.356,254.212 C536.611996,255.532007 535.628006,256.611996 534.404,257.452 C533.179994,258.292004 531.776008,258.903998 530.192,259.288 C528.607992,259.672002 527.000008,259.864 525.368,259.864 C522.775987,259.864 520.364011,259.372005 518.132,258.388 C515.899989,257.403995 513.992008,255.712012 512.408,253.312 L516.512,250.504 C517.472005,252.040008 518.683993,253.263995 520.148,254.176 C521.612007,255.088005 523.35199,255.544 525.368,255.544 C526.328005,255.544 527.287995,255.436001 528.248,255.22 C529.208005,255.003999 530.059996,254.668002 530.804,254.212 C531.548004,253.755998 532.147998,253.168004 532.604,252.448 C533.060002,251.727996 533.288,250.888005 533.288,249.928 C533.288,248.247992 532.664006,247.036004 531.416,246.292 C530.167994,245.547996 528.656009,244.960002 526.88,244.528 L522.272,243.448 C521.695997,243.303999 520.916005,243.064002 519.932,242.728 C518.947995,242.391998 517.988005,241.888003 517.052,241.216 C516.115995,240.543997 515.312003,239.668005 514.64,238.588 C513.967997,237.507995 513.632,236.176008 513.632,234.592 C513.632,232.863991 513.979997,231.352006 514.676,230.056 C515.372003,228.759994 516.307994,227.704004 517.484,226.888 C518.660006,226.071996 519.991993,225.460002 521.48,225.052 C522.968007,224.643998 524.503992,224.44 526.088,224.44 C528.440012,224.44 530.62399,224.895995 532.64,225.808 C534.65601,226.720005 536.215994,228.279989 537.32,230.488 L533.072,233.296 Z M558.416,253.168 L568.712,225.304 L574.472,225.304 L557.624,267.784 C556.615995,270.376013 555.332008,272.439992 553.772,273.976 C552.211992,275.512008 549.968015,276.28 547.04,276.28 C546.319996,276.28 545.588004,276.256 544.844,276.208 C544.099996,276.16 543.368004,276.016001 542.648,275.776 L543.152,271.168 C544.160005,271.696003 545.359993,271.96 546.752,271.96 C548.432008,271.96 549.751995,271.432005 550.712,270.376 C551.672005,269.319995 552.511996,267.83201 553.232,265.912 L555.68,259.432 L541.856,225.304 L547.832,225.304 L558.416,253.168 Z M637.76,240.424 L637.76,244.744 L601.04,244.744 L601.04,240.424 L637.76,240.424 Z M637.76,229.624 L637.76,233.944 L601.04,233.944 L601.04,229.624 L637.76,229.624 Z M671.168,265.768 C672.560007,267.640009 674.371989,269.139994 676.604,270.268 C678.836011,271.396006 681.319986,271.96 684.056,271.96 C686.456012,271.96 688.495992,271.612003 690.176,270.916 C691.856008,270.219997 693.211995,269.272006 694.244,268.072 C695.276005,266.871994 696.019998,265.468008 696.476,263.86 C696.932002,262.251992 697.16,260.536009 697.16,258.712 L697.16,252.664 L697.016,252.664 C695.479992,254.968012 693.608011,256.599995 691.4,257.56 C689.191989,258.520005 686.864012,259 684.416,259 C681.967988,259 679.676011,258.568004 677.54,257.704 C675.403989,256.839996 673.544008,255.652008 671.96,254.14 C670.375992,252.627992 669.128005,250.816011 668.216,248.704 C667.303995,246.591989 666.848,244.312012 666.848,241.864 C666.848,239.415988 667.279996,237.136011 668.144,235.024 C669.008004,232.911989 670.195992,231.064008 671.708,229.48 C673.220008,227.895992 675.01999,226.660004 677.108,225.772 C679.19601,224.883996 681.487988,224.44 683.984,224.44 C684.992005,224.44 686.059994,224.535999 687.188,224.728 C688.316006,224.920001 689.443994,225.255998 690.572,225.736 C691.700006,226.216002 692.815994,226.875996 693.92,227.716 C695.024006,228.556004 696.055995,229.623994 697.016,230.92 L697.16,230.92 L697.16,225.304 L701.912,225.304 L701.912,258.712 C701.912,260.536009 701.684002,262.47999 701.228,264.544 C700.771998,266.60801 699.884007,268.503991 698.564,270.232 C697.243993,271.960009 695.408012,273.399994 693.056,274.552 C690.703988,275.704006 687.632019,276.28 683.84,276.28 C680.479983,276.28 677.480013,275.728006 674.84,274.624 C672.199987,273.519994 669.800011,271.816012 667.64,269.512 L671.168,265.768 Z M672.032,241.72 C672.032,243.496009 672.355997,245.163992 673.004,246.724 C673.652003,248.284008 674.539994,249.651994 675.668,250.828 C676.796006,252.004006 678.115992,252.939997 679.628,253.636 C681.140008,254.332003 682.783991,254.68 684.56,254.68 C686.288009,254.68 687.931992,254.368003 689.492,253.744 C691.052008,253.119997 692.431994,252.244006 693.632,251.116 C694.832006,249.987994 695.755997,248.632008 696.404,247.048 C697.052003,245.463992 697.352,243.68801 697.304,241.72 C697.304,239.943991 697.016003,238.276008 696.44,236.716 C695.863997,235.155992 695.024006,233.788006 693.92,232.612 C692.815994,231.435994 691.472008,230.500003 689.888,229.804 C688.303992,229.107997 686.52801,228.76 684.56,228.76 C682.783991,228.76 681.140008,229.107997 679.628,229.804 C678.115992,230.500003 676.796006,231.435994 675.668,232.612 C674.539994,233.788006 673.652003,235.155992 673.004,236.716 C672.355997,238.276008 672.032,239.943991 672.032,241.72 Z M713.072,235.816 C713.072,234.327993 713.036,232.816008 712.964,231.28 C712.892,229.743992 712.832,227.752012 712.784,225.304 L717.464,225.304 L717.464,231.568 L717.608,231.568 C717.944002,230.655995 718.423997,229.780004 719.048,228.94 C719.672003,228.099996 720.427996,227.344003 721.316,226.672 C722.204004,225.999997 723.235994,225.460002 724.412,225.052 C725.588006,224.643998 726.919993,224.44 728.408,224.44 C729.752007,224.44 730.927995,224.583999 731.936,224.872 L731,229.552 C730.375997,229.311999 729.464006,229.192 728.264,229.192 C726.439991,229.192 724.880006,229.539997 723.584,230.236 C722.287994,230.932003 721.208004,231.819995 720.344,232.9 C719.479996,233.980005 718.844002,235.143994 718.436,236.392 C718.027998,237.640006 717.824,238.839994 717.824,239.992 L717.824,259 L713.072,259 L713.072,235.816 Z M743.384,212.344 C743.384,213.352005 743.024004,214.179997 742.304,214.828 C741.583996,215.476003 740.792004,215.8 739.928,215.8 C739.063996,215.8 738.272004,215.476003 737.552,214.828 C736.831996,214.179997 736.472,213.352005 736.472,212.344 C736.472,211.335995 736.831996,210.508003 737.552,209.86 C738.272004,209.211997 739.063996,208.888 739.928,208.888 C740.792004,208.888 741.583996,209.211997 742.304,209.86 C743.024004,210.508003 743.384,211.335995 743.384,212.344 Z M742.304,259 L737.552,259 L737.552,225.304 L742.304,225.304 L742.304,259 Z M787.376,259 L782.624,259 L782.624,253.384 L782.48,253.384 C781.711996,254.536006 780.800005,255.519996 779.744,256.336 C778.687995,257.152004 777.584006,257.823997 776.432,258.352 C775.279994,258.880003 774.092006,259.263999 772.868,259.504 C771.643994,259.744001 770.480006,259.864 769.376,259.864 C766.735987,259.864 764.324011,259.420004 762.14,258.532 C759.955989,257.643996 758.072008,256.408008 756.488,254.824 C754.903992,253.239992 753.668004,251.368011 752.78,249.208 C751.891996,247.047989 751.448,244.696013 751.448,242.152 C751.448,239.607987 751.891996,237.256011 752.78,235.096 C753.668004,232.935989 754.903992,231.064008 756.488,229.48 C758.072008,227.895992 759.955989,226.660004 762.14,225.772 C764.324011,224.883996 766.735987,224.44 769.376,224.44 C770.480006,224.44 771.643994,224.559999 772.868,224.8 C774.092006,225.040001 775.279994,225.423997 776.432,225.952 C777.584006,226.480003 778.687995,227.151996 779.744,227.968 C780.800005,228.784004 781.711996,229.767994 782.48,230.92 L782.624,230.92 L782.624,204.568 L787.376,204.568 L787.376,259 Z M756.632,242.152 C756.632,244.024009 756.931997,245.775992 757.532,247.408 C758.132003,249.040008 758.983994,250.455994 760.088,251.656 C761.192006,252.856006 762.523992,253.803997 764.084,254.5 C765.644008,255.196003 767.40799,255.544 769.376,255.544 C771.29601,255.544 773.083992,255.196003 774.74,254.5 C776.396008,253.803997 777.823994,252.856006 779.024,251.656 C780.224006,250.455994 781.159997,249.040008 781.832,247.408 C782.504003,245.775992 782.84,244.024009 782.84,242.152 C782.84,240.279991 782.504003,238.528008 781.832,236.896 C781.159997,235.263992 780.224006,233.848006 779.024,232.648 C777.823994,231.447994 776.396008,230.500003 774.74,229.804 C773.083992,229.107997 771.29601,228.76 769.376,228.76 C767.40799,228.76 765.644008,229.107997 764.084,229.804 C762.523992,230.500003 761.192006,231.447994 760.088,232.648 C758.983994,233.848006 758.132003,235.263992 757.532,236.896 C756.931997,238.528008 756.632,240.279991 756.632,242.152 Z M815.6,233.296 C814.879996,231.903993 813.920006,230.800004 812.72,229.984 C811.519994,229.167996 810.056009,228.76 808.328,228.76 C807.511996,228.76 806.684004,228.855999 805.844,229.048 C805.003996,229.240001 804.248003,229.539998 803.576,229.948 C802.903997,230.356002 802.364002,230.871997 801.956,231.496 C801.547998,232.120003 801.344,232.887995 801.344,233.8 C801.344,235.384008 801.895994,236.535996 803,237.256 C804.104006,237.976004 805.759989,238.599997 807.968,239.128 L812.792,240.28 C815.144012,240.808003 817.099992,241.875992 818.66,243.484 C820.220008,245.092008 821,247.095988 821,249.496 C821,251.320009 820.628004,252.891993 819.884,254.212 C819.139996,255.532007 818.156006,256.611996 816.932,257.452 C815.707994,258.292004 814.304008,258.903998 812.72,259.288 C811.135992,259.672002 809.528008,259.864 807.896,259.864 C805.303987,259.864 802.892011,259.372005 800.66,258.388 C798.427989,257.403995 796.520008,255.712012 794.936,253.312 L799.04,250.504 C800.000005,252.040008 801.211993,253.263995 802.676,254.176 C804.140007,255.088005 805.87999,255.544 807.896,255.544 C808.856005,255.544 809.815995,255.436001 810.776,255.22 C811.736005,255.003999 812.587996,254.668002 813.332,254.212 C814.076004,253.755998 814.675998,253.168004 815.132,252.448 C815.588002,251.727996 815.816,250.888005 815.816,249.928 C815.816,248.247992 815.192006,247.036004 813.944,246.292 C812.695994,245.547996 811.184009,244.960002 809.408,244.528 L804.8,243.448 C804.223997,243.303999 803.444005,243.064002 802.46,242.728 C801.475995,242.391998 800.516005,241.888003 799.58,241.216 C798.643995,240.543997 797.840003,239.668005 797.168,238.588 C796.495997,237.507995 796.16,236.176008 796.16,234.592 C796.16,232.863991 796.507997,231.352006 797.204,230.056 C797.900003,228.759994 798.835994,227.704004 800.012,226.888 C801.188006,226.071996 802.519993,225.460002 804.008,225.052 C805.496007,224.643998 807.031992,224.44 808.616,224.44 C810.968012,224.44 813.15199,224.895995 815.168,225.808 C817.18401,226.720005 818.743994,228.279989 819.848,230.488 L815.6,233.296 Z" id="usy-=-grids" fill="#83946B" sketch:type="MSShapeGroup"></path>
</g>
</svg>
</div>
<div class="container">
<h1>For-Loop Generated Responsive Grids using Susy</h1>
<p>Thanks to the dark magic of Susy and Sass we can now make our own grids with just a few lines of code! <a href="https://codepen.io/fuzzywalrus/full/cbvBl" target="_blank">View me Full Sized</a> </p><br>
<div class="col-large-12">
<p>col-large-12</p>
</div>
</div>
<div class="container">
<div class="col-large-1">
<p>col-large-1</p>
</div>
<div class="col-large-11">
<p>col-large-11</p>
</div>
</div>
<div class="container">
<div class="col-large-2">
<p>col-large-2</p>
</div>
<div class="col-large-10">
<p>col-large-10</p>
</div>
</div>
<div class="container">
<div class="col-large-3">
<p>col-large-3
</div>
<div class="col-large-9">
<p>col-large-9
</div>
</div>
<div class="container">
<div class="col-large-4">
<p>col-large-4</p>
</div>
<div class="col-large-8">
<p>col-large-8</p>
</div>
</div>
<div class="container">
<div class="col-large-5">
<p>col-large-5</p>
</div>
<div class="col-large-7">
<p>col-large-7</p>
</div>
</div>
<div class="container">
<div class="col-large-6">
<p>col-large-6</p>
</div>
<div class="col-large-6">
<p>col-large-6</p>
</div>
</div>
<div class="container">
<h3>Multi-column small grids</h3>
</div>
<div class="container">
<div class="col-large-4 col-small-4">
<p>col-large-4 & col-small-4</p>
</div>
<div class="col-large-8 col-small-8">
<p>col-large-8 & col-small-8</p>
</div>
</div>
<div class="container">
<div class="col-large-6 col-small-6">
<p>col-large-6 & col-small-6</p>
</div>
<div class="col-large-6 col-small-6">
<p>col-large-6 & col-small-6</p>
</div>
</div>
<div class="container">
<div class="col-large-3 col-small-6">
<p>col-large-6 & col-small-12</p>
</div>
<div class="col-large-3 col-small-6">
<p>col-large-6 & col-small-6</p>
</div>
<div class="col-large-3 col-small-6">
<p>col-large-6 & col-small-12</p>
</div>
<div class="col-large-3 col-small-6">
<p>col-large-6 & col-small-6</p>
</div>
</div>
@import "compass/css3";
@import "susy";
@import "compass/reset";
//Generating grids with Susy is pretty easy, it only requires a for loop to flexibly generate all the grids. In roughly 115 lines of Sass we generate around 280 lines of compliled CSS.
//vars
$breakPoint: 400px; //used for the repsonsive break point
$font-san-serif: 'Open Sans', sans-serif; //font-stack
$columns: 12; // This var controllers how many colums in the grid, change this variable and you can output whateve division of grids you want :)
$susy: (
columns: $columns,
gutters: 0,
);
/*================================================*/
/* Custom Susy Grid */
/*================================================*/
.container {
// Susy Container
@include container (1000px);
//default clearfix from Compass.
@import "compass/utilities/general/clearfix";
margin-bottom:20px;
}
//generated columns
$i: 1;
@for $i from 1 through $columns {
@if $i < $columns {
.col-large-#{$i} {
@include span($i);
float:left;
}
}
@if $i == $columns {
.col-large-#{$i} {
@include span($i);
//When using gutters you'll want to declare margin:0; here and manually set the width:100%;
}
}
}
/*================================================*/
/* Responsive Susy Grid */
/*================================================*/
@media only screen and (max-width: $breakPoint) {
//Sass is kinda pain so we need to make the mixin for the responsive code. We need easily clear the floats and 100% our large grid.
$i: 1;
%no-float {
float: none;
width:100%;
}
@mixin col-x-list {
@for $i from 1 through $columns {
.col-large-#{$i} { @extend %no-float; }
}
}
@include col-x-list;
//reset the counter
$i: 1;
//gen
@for $i from 1 through $columns {
@if $i < $columns {
.col-small-#{$i} {
@include span($i);
}
}
@if $i == $columns {
.col-small-#{$i} {
@include span($i);
//When using gutters you'll want to declare margin:0; here and manually set the width:100%;
}
}
}
}
/*================================================*/
/* Additional styling :D */
/*================================================*/
[class*="col-"] {
padding-top: 15px;
padding-bottom: 15px;
background-color: #eee;
background-color: rgba(197,224,159,.4);
border: 1px solid #ddd;
border: 1px solid rgba(197,224,159,1);
font-size: 8px;
p {
margin-left:5px;
font-size: 8px;
}
}
//essentials
body, p, .container {
font-family: $font-san-serif;
line-height: 1.4em;
}
svg {
max-width:100%;
}
a, a:visited {
color:#333;
&:hover {
color:#666;
}
}
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
//headlines
@for $i from 1 through 5 {
h#{$i} {
$headlinesizeMath: (46-($i*5));
font-size: #{$headlinesizeMath}px;
font-family: $font-san-serif;
letter-spacing: -1px;
line-height:1.4em;
padding-bottom:1em;
}
}
/*
_.---._ /\\
./' "--`\//
./ o \
/./\ )______ \__ \
./ / /\ \ | \ \ \ \
/ / \ \ | |\ \ \7
" " " "
OH NO THE AARDVARK ATE ALL THE JS :(
*/
Also see: Tab Triggers