Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

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.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

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.

Behavior

Auto Save

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <a class="underline" href="http://www.ffoodd.fr">C&#700;est psychologique<br>psychologique<br>psychologique<br>psychologique<br>psychologique</a>
              
            
!

CSS

              
                // Problème :
// Je ne parviens pas à caler le background-size sur une hauteur de ligne.
// On dirait que la hauteur de ligne n'est pas régulière ?
// Peut-être variabliser font-size pour exprimer line-height proportionnellement ?

@mixin underline($background: white, $line-height: 3.6rem, $position: 85%) {
  text-decoration: underline;
  
  .no-highcontrast.cssgradients  & {
    background-size: 100% $line-height;
    background-image:
      linear-gradient(
        to bottom,
        transparent 0%,
        transparent  calc($position - 1px),
        rgba( 255, 255, 255, .5 ) calc($position - 1px),
        rgba( 255, 255, 255, .5 ) calc($position),
        transparent  calc($position),
        transparent 100%
      ),
      linear-gradient(
        to bottom,
        transparent 0%,
        transparent  calc($position - 1px),
        currentColor calc($position - 1px),
        currentColor calc($position),
        transparent  calc($position),
        transparent 100%
      );
    line-height: $line-height;
    text-decoration: none;
    text-shadow:
      .05rem 0 0 $background, -.05rem 0 0 $background,    
      .1rem  0 0 $background, -.1rem  0 0 $background,    
      .2rem  0 0 $background, -.2rem  0 0 $background;
    width: auto;
    
    // Pour la sélection
    // https://developer.mozilla.org/en-US/docs/Web/CSS/::selection
    &::-moz-selection {
      background-color: invert($background);
      color: $background;
      text-shadow: none;
    }

    &::selection {
      background-color: invert($background);
      color: $background;
      text-shadow: none;
    }
  }
}

.underline {
  @include underline(white, 3.6rem, 86%);
  
  @media screen and (-ms-high-contrast: active) {
     & {
        background: none !important;
        text-decoration: underline !important;
     }
   }
}

// Démo
a {
  color: #007cc2;
  font: italic 3rem serif;
  
  &:hover,
  &:focus {
    color: rebeccapurple;
  }
}

              
            
!

JS

              
                /*! modernizr 3.2.0 (Custom Build) | MIT *
 * https://modernizr.com/download/?-cssgradients-addtest-setclasses !*/
!function(e,n,t){function o(e,n){return typeof e===n}function i(){var e,n,t,i,s,a,r;for(var u in l)if(l.hasOwnProperty(u)){if(e=[],n=l[u],n.name&&(e.push(n.name.toLowerCase()),n.options&&n.options.aliases&&n.options.aliases.length))for(t=0;t<n.options.aliases.length;t++)e.push(n.options.aliases[t].toLowerCase());for(i=o(n.fn,"function")?n.fn():n.fn,s=0;s<e.length;s++)a=e[s],r=a.split("."),1===r.length?Modernizr[r[0]]=i:(!Modernizr[r[0]]||Modernizr[r[0]]instanceof Boolean||(Modernizr[r[0]]=new Boolean(Modernizr[r[0]])),Modernizr[r[0]][r[1]]=i),f.push((i?"":"no-")+r.join("-"))}}function s(e){var n=c.className,t=Modernizr._config.classPrefix||"";if(d&&(n=n.baseVal),Modernizr._config.enableJSClass){var o=new RegExp("(^|\\s)"+t+"no-js(\\s|$)");n=n.replace(o,"$1"+t+"js$2")}Modernizr._config.enableClasses&&(n+=" "+t+e.join(" "+t),d?c.className.baseVal=n:c.className=n)}function a(){return"function"!=typeof n.createElement?n.createElement(arguments[0]):d?n.createElementNS.call(n,"http://www.w3.org/2000/svg",arguments[0]):n.createElement.apply(n,arguments)}function r(e,n){if("object"==typeof e)for(var t in e)p(e,t)&&r(t,e[t]);else{e=e.toLowerCase();var o=e.split("."),i=Modernizr[o[0]];if(2==o.length&&(i=i[o[1]]),"undefined"!=typeof i)return Modernizr;n="function"==typeof n?n():n,1==o.length?Modernizr[o[0]]=n:(!Modernizr[o[0]]||Modernizr[o[0]]instanceof Boolean||(Modernizr[o[0]]=new Boolean(Modernizr[o[0]])),Modernizr[o[0]][o[1]]=n),s([(n&&0!=n?"":"no-")+o.join("-")]),Modernizr._trigger(e,n)}return Modernizr}var f=[],l=[],u={_version:"3.2.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,n){var t=this;setTimeout(function(){n(t[e])},0)},addTest:function(e,n,t){l.push({name:e,fn:n,options:t})},addAsyncTest:function(e){l.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=u,Modernizr=new Modernizr;var c=n.documentElement,d="svg"===c.nodeName.toLowerCase(),g=u._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):[];u._prefixes=g,Modernizr.addTest("cssgradients",function(){for(var e,n="background-image:",t="gradient(linear,left top,right bottom,from(#9f9),to(white));",o="",i=0,s=g.length-1;s>i;i++)e=0===i?"to ":"",o+=n+g[i]+"linear-gradient("+e+"left top, #9f9, white);";Modernizr._config.usePrefixes&&(o+=n+"-webkit-"+t);var r=a("a"),f=r.style;return f.cssText=o,(""+f.backgroundImage).indexOf("gradient")>-1});var p;!function(){var e={}.hasOwnProperty;p=o(e,"undefined")||o(e.call,"undefined")?function(e,n){return n in e&&o(e.constructor.prototype[n],"undefined")}:function(n,t){return e.call(n,t)}}(),u._l={},u.on=function(e,n){this._l[e]||(this._l[e]=[]),this._l[e].push(n),Modernizr.hasOwnProperty(e)&&setTimeout(function(){Modernizr._trigger(e,Modernizr[e])},0)},u._trigger=function(e,n){if(this._l[e]){var t=this._l[e];setTimeout(function(){var e,o;for(e=0;e<t.length;e++)(o=t[e])(n)},0),delete this._l[e]}},Modernizr._q.push(function(){u.addTest=r}),i(),s(f),delete u.addTest,delete u.addAsyncTest;for(var h=0;h<Modernizr._q.length;h++)Modernizr._q[h]();e.Modernizr=Modernizr}(window,document);

// Modernizr addTest for high contrast mode
// https://modernizr.com/docs#modernizr-addtest
// Based on Karl Groves & Hans Hillen test
// http://jsfiddle.net/karlgroves/XR8Su/6/
// Determines if document is in High Contrast Mode or not,
// and if user customized colors in his browsers
// Gaël Poupard — ffoodd.fr
Modernizr.addTest("highcontrast", function() {
  var objA = document.createElement("a"),
      strColor;
  objA.style.color = "rgb(31, 41, 59)";
  document.documentElement.appendChild(objA);
  strColor = document.defaultView ? document.defaultView.getComputedStyle(objA, null).color : objA.currentStyle.color;
  strColor = strColor.replace(/ /g, "");
  document.documentElement.removeChild(objA);
  return strColor !== "rgb(31,41,59)";
});
              
            
!
999px

Console