Edit in JSFiddle

.commonMessage {  
  border: 1px solid #000;  
  padding: 20px;  
  color: #313131;
  margin-bottom:10px;
}  
.success {  
  @extend .commonMessage;  
  border-color: green;  
}  
.error {  
  @extend .commonMessage;  
  border-color: red;  
}  
.warning {  
  @extend .commonMessage;  
  border-color: yellow;  
} 
<div class="success">
This is Success Message
</div>

<div class="error">
This is Success Message
</div>

<div class="warning">
This is Success Message
</div>