I hope someone can help me with trying to find a beautiful elegant way to get the border on the CSS arrow border.
I am trying to create this:

Here is my code:
HTML
<div class="message-container customer"> <p class="message">Great thanks</p> </div>
CSS
.message { width: auto; max-width: 66%; padding: 12px 30px; box-sizing: border-box; background: #ffffff; box-shadow: 0 2px 0 2px rgba(177, 177, 177, .07), 0 2px 0 0 rgba(0, 0, 0, .1); margin: 4px 0 0 0; position: relative; float: right; border-right: 4px solid #0892cb; border-radius: 5px 0 0 5px; } .message:after { top: 100%; right: 0; border: solid transparent; content: " "; height: 0; width: 0; position: absolute; pointer-events: none; border-color: rgba(255, 255, 255, 0); border-bottom-color: #FFFFFF; border-width: 10px; margin-right: -14px; margin-top: -10px; transform: rotate(45deg); box-shadow: 0 2px 0 2px rgba(177, 177, 177, .07), 0 2px 0 0 rgba(0, 0, 0, .1); }
Here is a working JS script https://jsfiddle.net/kdeo3wpg/
As you can see, I have a blue frame to the right of the main message, but I canβt figure out how to get the blue border on the arrow. If at all possible, I would really like to avoid using an image. It would be great to find a CSS-only solution.
I was thinking of trying to use the sudo :before element, but I cannot get the full control that I need.
Any help would be greatly appreciated.
UPDATE
I managed to find a solution, but honestly, this is not very clean.
https://jsfiddle.net/kdeo3wpg/1/
What I did was add a new element, which is the width of the border and has the same background color. Then I set the height a little less than the height of the CSS arrow. Then I give my new CSS arrow element a background color on the border.
Here is the new code:
HTML
<div class="message-container customer"> <p class="message"> Great thanks <span class="arrow-border"></span> </p> </div>
CSS
.message { width: auto; max-width: 66%; padding: 12px 30px; box-sizing: border-box; background: #ffffff; box-shadow: 0 2px 0 2px rgba(177, 177, 177, .07), 0 2px 0 0 rgba(0, 0, 0, .1); margin: 4px 0 0 0; position: relative; float: right; border-right: 4px solid #0892cb; border-radius: 5px 0 0 5px; } .message:after { top: 100%; right: 0; border: solid transparent; content: " "; height: 0; width: 0; position: absolute; pointer-events: none; border-color: rgba(255, 255, 255, 0); border-bottom-color: #FFFFFF; border-width: 10px; margin-right: -14px; margin-top: -10px; transform: rotate(45deg); box-shadow: 0 2px 0 2px rgba(177, 177, 177, .07), 0 2px 0 0 rgba(0, 0, 0, .1); } .arrow-border { position: absolute; background: #0892cb; width: 4px; height: 9px; bottom: -9px; right: -4px; z-index: 1; } .arrow-border:after { top: 100%; right: 0; border: solid transparent; content: " "; height: 0; width: 0; position: absolute; pointer-events: none; border-color: rgba(255, 255, 255, 0); border-bottom-color: #0892cb; border-width: 3px; margin-right: -3px; margin-top: -3px; transform: rotate(45deg); box-shadow: 0 2px 0 2px rgba(177, 177, 177, .07), 0 2px 0 0 rgba(0, 0, 0, .1); }
While this solution works, I believe that there may be better and cleaner options, so I'm still open to suggestions.