Edit on
mixin lorem(size)
  if size == 'large'
    | Stet clita kasd gubergren, no sea takimata sanctus est Lorem vero eos et accusam et justo duo dolores et ipsum dolor sit amet.  At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
  else if size == 'medium'
    | Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. 
  else if size == 'small'
    | At vero eos et accusam et justo duo dolores.  
  else
    | Lorem


mixin bubble(dir,size)
  .bubble(class=dir)
    .content
      +lorem(size)

.chat 
  +bubble('left','medium')
  +bubble('right','small')
  +bubble('left','small')
  +bubble('right','large')
  +bubble('left', 'small')
  +bubble('left','medium')
View Compiled
@import url(https://fonts.googleapis.com/css?family=Roboto:300);

$color-in: #fff;
$color-out: #000;
$background-color-in: #E64A19;
$background-color-out: #E0E0E0;
$tip-stroke: 30px;
$tip-width: 50px;
$tip-margin: 20px;
$tip-height: 40px;
$radius: 100% 100%;
$tip-x: $tip-stroke - $tip-width;
$tip-inset: $tip-height*0.75;
$tip-y: $tip-height*-1 + $tip-inset;
$tip-stroke-y: 9px;
$tip-stroke-size: $tip-stroke-y*-1;
$tip-stroke-x: $tip-stroke*-1 + $tip-stroke-size + 1;
$font-family: 'Roboto', sans-serif;
$font-weight: 300;
$font-size: 12px;
$line-height: 1.4;
$content-padding: 10px;

body {
  margin: 0;
  background: #444;
}
.chat {
  height: 100vh;
  width: 300px;
  margin: auto;
  background: #fff;
  overflow: auto;
}

.bubble {
  position: relative;
  width: 70%;
  margin-top: 10px;
  font-family: $font-family;
  font-weight: $font-weight;
  font-size: $font-size;
  line-height: $line-height;
  
  &:before {
    content: '';
    position: absolute;
    z-index: 0;
    bottom: $tip-y;
    height: $tip-height;
    width: $tip-width;

    
  }
  
  &.left {
    float: left;
    margin-left: $tip-margin;
    &:before {
      left: $tip-x;
      border-bottom-right-radius: $radius;
      box-shadow: 
        $tip-stroke-x 
        $tip-stroke-y 
        0 
        $tip-stroke-size 
        $background-color-in 
        inset;    
    }
    
    .content {
      background: $background-color-in;
      color: $color-in;
    }
  }
  &.right {
    float: right;
    margin-right: $tip-margin;
    &:before {
      right: $tip-x;
      border-bottom-left-radius: $radius;
      box-shadow: 
        $tip-stroke-x*-1 $tip-stroke-y 
        0 
        $tip-stroke-size 
        $background-color-out 
        inset;     
    }
    
    .content {
      background: $background-color-out;
      color: $color-out;
    }
  }
  
  .content {
    position: relative;
    z-index: 1;
    padding: $content-padding;
  }
}
View Compiled
Rerun