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

              
                


<p><span></span>Main placeholder text. Since this book is a companion piece to a real-life event, whose content will be shared online through video and photographs, we decided to print it entirely in black and white (even the photographs and graphic elements) – except for vibrant bursts of gradated color on the inside of the book’s french-folded pages, which appear at certain angles and show through the paper stock. French folds were our way of underscoring the physical construction of the book, showing the way it’s made from larger sheets of paper that are trimmed and folded into signatures, assembled, and bound. (All books are printed and assembled in some variation of this process – it’s just more common that the folded edges are trimmed off). By leaving the french folding in place, the “code” of the bookmaking process is revealed. These techniques and formal decisions helped to bring unity to the content, much like Material Design.Main Text – Since this book is a companion piece to a real-life event, whose content will be shared online through video and photographs, we decided to print it entirely in black and white (even the photographs and graphic elements) – except for vibrant bursts of gradated color on the inside of the book’s french-folded pages, which appear at certain angles and show through the paper stock. French folds were our way of underscoring the physical construction of the book, showing the way it’s made from larger sheets of paper that are trimmed and folded into signatures, assembled, and bound. (All books are printed and assembled in some variation of this process – it’s just more common that the folded edges are trimmed off). By leaving the french folding in place, the “code” of the bookmaking process is revealed. These techniques and formal decisions helped to bring unity to the content, much like Material Design.</p>  


              
            
!

CSS

              
                
$fontsize: 1.6; //mm
$lineheightmin: 2;

$fontfamily: Georgia;
$charsize: 0.481; //Helvetica//0.52; //Georgia: 0.481//445312
$letterspacing: 0.05ex;
$wordspacing: 1;


//--------- Functions -----
// -----
@function mmpx($mm) {
  $ppi: 220.5;
  $fakeppi: $ppi/2880*1680;
  @return round($mm/25.4*72/$fakeppi*$ppi); //#{}px
};


@function map($value, $inMin, $inMax, $outMin, $outMax) { //number value range map 
  // Figure out how 'wide' each range is
  $leftSpan: $inMax - $inMin;
  $rightSpan: $outMax - $outMin;
    // Convert the left range into a 0-1 range (float)
  $valueScaled: ($value - $inMin) / $leftSpan;
    // Convert the 0-1 range into a value in the right range.
@return $outMin + ($valueScaled * $rightSpan);
};

@function num($number) { //strips off the units
  @return $number / ($number * 0 + 1);
}

@function pxvw($px, $width) {
  @return #{100/$width*$px}vw;
};

@function vwpx($vw, $width) {
  @return $width/100*$vw;
};

@function mmvw($px, $width) {
  @return 100/$width*mmpx($px);
};
@function expx($ex, $fontsize) {
  @return $fontsize * $charsize * $ex ;
};

@function ptpx($pt) {
  @return #{$pt/12*16}px;
};

@function interpol($min_window, $min_value, $max_window, $max_value) {
    $proportion: $min_window / ($max_window - $min_window);
    $value_difference: $max_value - $min_value;
@return calc(#{$min_value - ($value_difference)*($proportion)}px + #{pxvw(($value_difference)*($proportion),$min_window)});

};
//value width map // 
@mixin interpolm($prop, $min_window, $min_value, $min_limit, $max_window, $max_value, $max_limit ) {
   
   $proportion: $min_window / ($max_window - $min_window);
    $value_difference: $max_value - $min_value;
  
  #{$prop}: calc(#{$min_value - ($value_difference)*($proportion)}px + #{pxvw(($value_difference)*($proportion),$min_window)});
 //Limits
  @if $min_limit {
    @media all and (max-width: #{$min_window}px) { #{$prop}: #{$min_value}px; }}
  @if $max_limit {
    @media all and (min-width: #{$max_window}px) { #{$prop}: #{$max_value}px; }}
}

//------------
//$lineheight: 3.5ex;




$fontsizemm: $fontsize;

$fontsize: mmpx($fontsize / $charsize * 1);

$fontsizecalc: calc(#{0.93*$fontsize}px + #{pxvw(0.07*$fontsize,400)});
//calc(#{5.5*$fontsize}px + #{pxvw(0.5*$fontsize,400)}vw);

$lineheight: calc((0.7em * #{$lineheightmin}) + #{100/400*0.3*$fontsize}vw);
//$lineheight: calc(#{mmpx($fontsizemm*$lineheightmin)}px + #{mmvw($fontsizemm,400)}vw);


body{
  margin: calc(4vw + 10px); //#{pxvw(50,280)} // $margin: 20
  font-family: $fontfamily;
}

p {
  font-size: $fontsize + px;//calc; //$fontsize + px;//
  font-size: interpol(400,$fontsize,730,$fontsize + 1);
  //@media (max-width: 400px)  { font-size: $fontsize + px;}
  @media (min-width: 730px) {
    font-size:$fontsize + 1 + px; 
     font-size: interpol(730,$fontsize + 1,1000,$fontsize + 2);
  } 
    //ptpx(12);//$fontsize;
  //mmpx(4.2333)
  max-width: 80ex;
  //line-height: $lineheight;
  letter-spacing: $letterspacing;
    
  line-height: 1.5em; //fallback
  line-height: interpol(150,expx(2.2, $fontsize),730,expx(3.5, $fontsize)); //px
  @media (max-width: 150px)  { line-height:2.2ex;}
  @media (min-width: 729px) {line-height:expx(3.5, $fontsize) + px;//3.5ex; 
  }
  
}

span {
  left:0;
  position: absolute;
  display:inline-block;
 // width: #{expx(10, $fontsize)}px; //pxvw(100,400);
  height: mmpx($fontsizemm) + px;//$fontsize * $charsize + px;
  //calc(#{mmpx(1)}px + #{mmvw(1,400)});//mmpx(2) + px;// ;
  //calc(mmpx(1) + px + mmvw(1,400));
  background-color: black;

  
  width: interpol(400,300,1150,50); //px
  @media (max-width: 400px)  { width: pxvw(300,400); }
  @media (min-width: 1150px) { width: 50px; }
  
  //next
  //@include interpolm(width,0,300, 400,300, 600,100, 1150,50); //px
  //@include interpolm(width, true, 300@0, 300@400, 100@600, 50@1150);
  //@include interpolm(width, true, 0:300, 400:300, 600:100, 1150:50)
  //@include widthmap(prop, interpol, window_width:value)
  
}
              
            
!

JS

              
                
              
            
!
999px

Console