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


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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


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.

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.


                <div class="container">
      <h1>Demo Widget TorinoMeteo</h1>
      <h2>Image widget</h2>
   <p>Modifica il valore delle variabili definite nella tab CSS per personalizzare il widget.<br />Preleva poi il CSS compilato (tab CSS, freccia in alto a destra) per utilizzarlo sul tuo sito (rimuovi gli stili di sola presentazione).</p>
   <p>Modifica gli attributi del tag <code>tmrealtime</code> per cambiare le icone o sostituirle con delle scritte.</p>
   <div class="widget-container">
         lastMeasureLabel="<i class='wi wi-time-1'></i>"
         temperatureLabel="<i class='wi wi-thermometer'></i>"
         rhLabel="<i class='wi wi-humidity'></i>"
         pressureLabel="<i class='wi wi-barometer'></i>"
         windLabel="<i class='wi wi-strong-wind'></i>"
         rainRateLabel="<i class='wi wi-raindrops'></i>"
         rainLabel="<i class='wi wi-umbrella'></i>"


                // settings versione 1
$caption-bg: rgba(0, 0, 0, .6); // colore sfondo caption
$caption-color: #fff; // colore dati in caption
$title-color: #ffff00; // colore titolo (nome stazione)
$icons-color: #ffff00; // colore icone
$temp-cold-color: #9999aa; // colore temperature [-273.15, 10)
$temp-warm-color: #ff9900; // colore temperature [10, 20)
$temp-hot-color: #ff4444;  // colore temperature [20, ∞)

// widget container
.widget-container {
  display: inline-block;
  margin: 3rem auto;
  text-align: left;
  width: 600px;
  max-width: 100%;

// tm-widgets
.tm-realtime-widget {
  font-family: 'Nova Mono';
  font-size: .9rem;
  width: 100%;

.tm-realtime-widget h1 {
  font-size: 1rem;
   color: $title-color;

.tm-realtime-widget h1, .tm-realtime-last-measure {
  display: inline-block;

.tm-realtime-widget header > div {
  border-radius: 8px 8px 0 0;
  padding: 8px;
  text-align: center;

.tm-realtime-widget header img {
  height: 40px;

.tm-realtime-image-wrapper {
  position: relative;

.tm-realtime-caption {
  box-sizing: border-box;
  position: absolute;
  color: $caption-color;
  bottom: 4px;
  background: $caption-bg;
  padding: 0 16px 8px;
  width: 100%;

.tm-realtime-data {
  display: flex;

.tm-realtime-data > div {
  margin-right: 8px;

.tm-realtime-temperature .tm-realtime-value {
   font-weight: bold;

.tm-temp-cold {
  color: $temp-cold-color;
.tm-temp-warm {
  color: $temp-warm-color;
.tm-temp-hot {
  color: $temp-hot-color;

.wi {
   color: $icons-color;

span[class^="direction-"]::before {
  content: '\f0b1';
  font-family: 'weathericons';
  display: inline-block;
  margin-right: 5px;

.direction-up-right::before {
  transform: rotate(45deg);

.direction-right::before {
  transform: rotate(90deg);

.direction-down-right::before {
  transform: rotate(135deg);

.direction-down::before {
  transform: rotate(180deg);

.direction-down-left::before {
  transform: rotate(225deg);

.direction-left::before {
  transform: rotate(270deg);

.direction-up-left::before {
  transform: rotate(315deg);

// presentational
body {
   margin: 0;
   padding: 0;
   font-family: 'Ubuntu', sans-serif;
   text-align: center;
   .container {
      margin: auto;
      max-width: 800px;
   > header {
      background-color: #fafafa;
      color: #444;
      padding: 16px;
      text-align: center;
      .logo {
         height: 50px;
      h1 {
         font-size: 1.4rem;