Pen Settings

HTML

CSS

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

JavaScript

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

Behavior

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.

HTML

              
                %div.sign_in_with_twitter.light
  %div.divider
  %div.container
    %div.icon
    Sign in with Twitter

-# for a darker version, just add the class "dark", like so:

%div.sign_in_with_twitter.dark
  %div.divider
  %div.container
    %div.icon
    Sign in with Twitter

-# presentational stuff for codepen; not part of the button
.notes
  %h1.title
    Scalable HTML5 + CSS Twitter button by
    %a{:href => "https://twitter.com/jm3"} @jm3
    in dark + light variations

  %h2.footnote
    %a{:href => "https://github.com/jm3/sign-in-with-twitter-button"}
      Grab the code from Github: jm3/sign-in-with-twitter-button
              
            
!

CSS

              
                @import compass

.sign_in_with_twitter
  height:    60px
  width:     280px
  position:  relative

.sign_in_with_twitter div.container
  background:     #c1e6ea -moz-linear-gradient( center bottom, rgb(161,200,209) 0%, rgb(211,245,246) 81%)
  background:     #c1e6ea -webkit-gradient(linear, left bottom, left top, color-stop(0,  #aed6dc), color-stop(0.9, #d3f5f6))
  border-radius:  8px
  border:         2px solid #B1D4DC
  color:          #293f46
  font:           bold 24px "Lucida Grande"
  height:         49px
  line-height:    50px
  padding:        2px 23px 3px 6px
  position:       absolute
  text-align:     right
  text-shadow:    #fff 1px 1px 1px
  width:          317px

.sign_in_with_twitter.dark div.container
  background:   #3ea8bb -moz-linear-gradient( center bottom, rgb(37,146,173) 0%, rgb(70,214,219) 81%)
  background:   #3ea8bb -webkit-gradient(linear, left bottom, left top, color-stop(0, rgb(37,146,173)), color-stop(0.81, rgb(70,214,219)))
  border:       2px solid #1D7285
  color:        #fff
  text-shadow:  #2F808F -1px -1px 1px

.sign_in_with_twitter > div.divider
  border-left:   2px solid #ADD1DD
  border-right:  2px solid #C6E9ED
  height:        54px
  left:          58px
  position:      absolute
  top:           2px
  z-index:       2

.sign_in_with_twitter.dark > div.divider
  border-left:   2px solid #237C8F
  border-right:  2px solid #46BFD2

// iPhone-friendliness
@media only screen and (min-device-width: 320px) and (max-device-width: 480px)
  .sign_in_with_twitter.dark div.container, .sign_in_with_twitter div.container
    width: 370px

.sign_in_with_twitter .icon
  background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAMAAADDpiTIAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRF////////VXz1bAAAAAJ0Uk5T/wDltzBKAAAJLUlEQVR42uzdS4LbOBBEwcL9Lz3rsdtqkgLBAjNyrZEsvBi7W98aFr1yBAAYAAaAAWAAGAAGgAFgABgABoABYAAYAAaAAWAAGAAGgAFgABgABoABYAAYAAaAAWAAGAAGgAFgABgABoABYAAYAAaAAWAAGAAGgAFgABgABoABYAAYAAaAAWAAGAAGgAFgABgABoABYAC0PtOfBkBq+eYOAFjWvqcCABbH74YAgAfid0IAwFP1mxgA4Mn8DQgA8Gj9RQYKgMb5byfw8foBeL7+vQR+uXYAWuS/j8BvVw1Ak/z3EPj9igHo0386gSNXC0Cj/HMJHLtOAFrln0fg6DUC0K3/FAHHrw+AbvknEDhzbQD0y/+dgJNXdvKmSv/eBE5fU529ev0bC7hwRacBlPxNCVy7ljp/E/p3FHD1SgDo2//4UX9xFXXhNPTvJeCra7gCoOTvI+Dr//7Seejfg8AMQPMfXdZ/jYA5/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rf3//BtAzqz8P/wTIGlU/x9+BhA1KP/PPwQKm9P/H78FaBuS/5+/Bsqbkf/D4wASR/T/9ECQyu/P//mRQKFfn/+3h4LFfnn+358LEPzd/Q88GaT5i/MfezZQ99fmP/p0sPYvzX/89QDyj2wAXvIVDyCYwBgABBMYA4BgAmMAkEtgvH9X7qP84QCGj3mLB+AzvuMBDN/wFg/gpQTGACDXwEjbhHusfjiAtxgYA4BcAyN1M++5+uEA9jQwsjf//qsfDmAbA+LfBmADBMrfDaCxAdUXAeiIQPHFADohUPshAB0QKP0wgAcViNwGwGoF8nYEsIaBss0B3MVA0a0ATIQg5c4ArllQ740ADAADwAAwAAwAA8AAMAAMAAPAADAADAADwAAwAAwAA8AAMAAMAAPAADAADAADwAAwAAwAA8AAMAAMAAPAADAADAAAHAEABoABYAAYAAaAAWAAGAAGgAFgABgABoABYK/bfwIMALCYOb0y/IBxAAAAAElFTkSuQmCC) no-repeat 0 0
  background-size:  82% auto
  height:           30px
  left:             12px
  position:         absolute
  top:              10px
  width:            40px
// end button code

// codepen presentational stuff
html
  background:   #111
  color:        #fff
  font-family:  "Lucida Grande"
  font-size:    16px
  margin:       2.0em

.notes
  position: absolute
  top: 30px
  left: 0
  width: 100%
  a
    color: #aed6dc
    display: inline-block
    padding: 3px 8px 5px
    background-color: #042433
    border-radius: 3px
  .title, .footnote
    margin: 0 auto
    display: block
    text-align: center
    width: 640px
  .footnote
    margin-top: 300px

h1
  font-size: 16px
h2
  font-size: 14px
p
  margin: 1.5em
a:hover
  color: #fff

.sign_in_with_twitter
  &.light
    margin: 100px 0 30px 0
// end codepen presentational stuff
              
            
!

JS

              
                
              
            
!
999px

Console