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.


<header class='pen-title'>
  <h1>Exploring a tailwind component: </h1>

<!-- A concern of mine... is the markup -->

<aside class='component user-card'>
    <figure class='avatar'>
      <img src='' alt='$seo-todo' />

    <h1 class='name'>@sheriffderek</h1>
    <h2 class='position'>Designer at</h2>
    <button class='action'>

<!-- not a single 'generic divider' / but I might put on in the button - since flex-box doesn't work in that element -->

<!-- I only use 'main' with no class when the components are at a level where there will never be a sub-component -->


in 2020 I'd probably use a custom component + probably css grid

  <picture class='avatar'>
    <img src='' alt='$seo-todo' />

  <h1 class='name'>@sheriffderek</h1>
  <h2 class='position'>Designer at</h2>
  <button class='action'>


<figure class="tailwind-example">
  <img src="" alt="" />
<p>From the website ^</p>

<h2 class="description">And how I would normally write the markup for a 'card' like component</h2>

<figure class="my-example">
  <img src="" alt="" />

<h2 class="description">I think a Jr. dev could understand this markup. With tailwind, I may not need to write any CSS / but that's pretty scary for me. The markup alone hurts my eyes - and then having to learn all of those mod classes would take me so far away from my current practices / that it couldn't be a win for me. However... there must be some other JS magic that allows you to share code between addons and all the stuff in any given eco-system or something - that I'm not using here.</h2>

<p>Probably something even cleaner in 2020</p>

<figure class="my-example">
  <img src="" alt="" />



but the point should be the same for any CSS / processed or not


// site-wide styles would be setup globally (not just for this component)
// I made a quick example of that here: 

  box-shadow: 0 5px 8px 2px $shadow
// OK... so, this is how'd I'd normally do it //
  display: flex
  flex-direction: column
  padding: $pad
  max-width: 400px
  background $white
  border-radius: $tight-corners
    max-width: 80px
    margin-top: $pad
    color: $gray
    margin-top: $pad*.25
    background-color: white
    margin-top: $pad*.75
  @media $break-point-1
    flex-direction: row
    align-items: center
      margin-top: 0
      margin-left: $pad

// in my case, instead of adding classes to the markup / I just plug and play with some mixins (usually I'd have some @media mixin-rules in there too)

// I realize that this is basically the same idea as adding classes to them markup (but likely larger in file size... - however, I'm more concerned about the developer experience than files size
// this is the component-level CSS (with things like 'avatar' that might already be it's own component / button etc.)

/* I THINK* - that an intern could jump in and ammend these styles - but I'm not sure that they could memorize the tailwind mod classes very quickly - and wouldn't they step on each other? What about when there's even more markup from JS frameworks to contend with / such as v-for and dynamic class bindings. How would you know what was happening? */


  background: #F1F5F8
  padding: 2rem
  width: 700px
  margin-top: 2rem

  padding: $pad*2 0 $pad
  width: 440px

  text-transform: uppercase
  font-size: 24px
  margin-bottom: 2rem


// The @apply vs class in the markup / is interesting


.btn-grey {
  @apply bg-grey-light text-grey-darkest font-bold py-2 px-4 rounded;

where as I'd do something like this - and add mixins() - in the stylus way

    margin-top: $pad