Bootstrap 4.1 floating labels - css

I've found on Google a doc example for Bootstrap 4.1 in which they feature floating labels: getbootstrap.com/docs/4.1/examples/floating-labels/
In that page, however, it is not explained how that can be achieved, and I can't find anything in the docs for v. 4.1. Floating labels are not even listed as a new feature in the ship list.
Does anyone know if floating labels are supported?

It says on the Bootstrap examples page that floating-labels are...
"Experiments - Examples that focus on future-friendly features or
techniques."
Like many of the other examples, there's an additional CSS file used in the example...
Using the floating-labels.css they work as expected in the supported browsers...
https://www.codeply.com/go/X9VbHqzD4B

Best way for me is using transform translate. It is smoother. I have added extra classes to prevent overwriting bootstraps original classes.
body{padding:75px}
.form-group.floating>label {
bottom: 34px;
left: 8px;
position: relative;
background-color: white;
padding: 0px 5px 0px 5px;
font-size: 1.1em;
transition: 0.1s;
pointer-events: none;
font-weight: 500 !important;
transform-origin: bottom left;
}
.form-control.floating:focus~label{
transform: translate(1px,-85%) scale(0.80);
opacity: .8;
color: #005ebf;
}
.form-control.floating:valid~label{
transform-origin: bottom left;
transform: translate(1px,-85%) scale(0.80);
opacity: .8;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"/>
<div class="form-group floating">
<input type="text" class="form-control floating" id="usr" required value="">
<label for="usr">Username</label>
</div>

Styles they ware using in that mentioned example site
:root {
--input-padding-x: .75rem;
--input-padding-y: .75rem;
}
html,
body {
height: 100%;
}
body {
display: -ms-flexbox;
display: -webkit-box;
display: flex;
-ms-flex-align: center;
-ms-flex-pack: center;
-webkit-box-align: center;
align-items: center;
-webkit-box-pack: center;
justify-content: center;
padding-top: 40px;
padding-bottom: 40px;
background-color: #f5f5f5;
}
.form-signin {
width: 100%;
max-width: 420px;
padding: 15px;
margin: 0 auto;
}
.form-label-group {
position: relative;
margin-bottom: 1rem;
}
.form-label-group > input,
.form-label-group > label {
padding: var(--input-padding-y) var(--input-padding-x);
}
.form-label-group > label {
position: absolute;
top: 0;
left: 0;
display: block;
width: 100%;
margin-bottom: 0; /* Override default `<label>` margin */
line-height: 1.5;
color: #495057;
border: 1px solid transparent;
border-radius: .25rem;
transition: all .1s ease-in-out;
}
.form-label-group input::-webkit-input-placeholder {
color: transparent;
}
.form-label-group input:-ms-input-placeholder {
color: transparent;
}
.form-label-group input::-ms-input-placeholder {
color: transparent;
}
.form-label-group input::-moz-placeholder {
color: transparent;
}
.form-label-group input::placeholder {
color: transparent;
}
.form-label-group input:not(:placeholder-shown) {
padding-top: calc(var(--input-padding-y) + var(--input-padding-y) * (2 / 3));
padding-bottom: calc(var(--input-padding-y) / 3);
}
.form-label-group input:not(:placeholder-shown) ~ label {
padding-top: calc(var(--input-padding-y) / 3);
padding-bottom: calc(var(--input-padding-y) / 3);
font-size: 12px;
color: #777;
}

If you really want floating label, see this awesome Bootstrap 4 theme : http://djibe.github.io/material/docs/4.4/material/text-fields/

SCSS version below including support for textarea and excluding styles from IE11, which doesn't support :placeholder-shown.
:root {
--input-padding-x: .75rem;
--input-padding-y: .75rem;
}
.floating-label {
$placeholderColour: $middleGrey;
position: relative;
input, textarea, label {
padding: var(--input-padding-y) var(--input-padding-x);
}
label {
position: absolute;
top: 0;
left: 0;
display: block;
margin-bottom: 0;
line-height: 1.5;
color: $placeholderColour;
border: 1px solid transparent;
border-radius: .25rem;
transition: all .1s ease-in-out;
&:hover {
cursor: text;
}
}
input::-webkit-input-placeholder {
color: transparent;
}
input:-ms-input-placeholder {
color: transparent;
}
input::-ms-input-placeholder {
color: transparent;
}
input::-moz-placeholder {
color: transparent;
}
input::placeholder {
color: transparent;
}
textarea::-webkit-input-placeholder {
color: transparent;
}
textarea:-moz-placeholder {
color: transparent;
}
textarea::-moz-placeholder {
color: transparent;
}
textarea:-ms-input-placeholder {
color: transparent;
}
textarea::placeholder {
color: transparent;
}
input:not(:placeholder-shown),
textarea:not(:placeholder-shown) {
padding-top: calc(var(--input-padding-y) + var(--input-padding-y) * (2 / 3));
padding-bottom: calc(var(--input-padding-y) / 3);
}
input:not(:placeholder-shown) ~ label,
textarea:not(:placeholder-shown) ~ label {
padding-top: calc(var(--input-padding-y) / 3);
padding-bottom: calc(var(--input-padding-y) / 3);
font-size: 12px;
&:hover {
cursor: default;
}
}
#media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
label {
display: none;
}
textarea:-ms-input-placeholder, input:-ms-input-placeholder {
color: $placeholderColour;
}
textarea::-ms-input-placeholder, input::-ms-input-placeholder {
color: $placeholderColour;
}
}
}

I've created an input floating label for Bootstrap 4 & 5 (not the same look that Bootstrap provides): https://github.com/tkrotoff/bootstrap-floating-label
Here is the online demo: https://codesandbox.io/s/github/tkrotoff/bootstrap-floating-label/tree/codesandbox.io

Related

CSS Autofill Styes Not Behaving As Desired

Using just CSS, I have been working on the login section of my site. I love offering visual feedback for each state anything is on on the page, whether you've clicked it, hovered over it, then depending on what state it is, such as invalid, disabled, or whatnot, however when using the browsers autofill, this is playing havoc on, my thought to be completed section!
I am using Google Chrome, always the latest version.
How It Currently Works
Disabled
No input focus
Enter button has disabled styling
Default
Focus changes input styles
Entering text will change Enter styles
Button has :hover and :active styles for this state
Active - This is when something has been entered and you focus out
Input border and label text color property changes, different to not having any text inputted.
What The Problem Is
I have been attempting to have all current styles and methods stay whilst you use the browser's autofill. I have almost got this completely working, but I am facing these problems:
using autofill...
When you hover over the autofill list, it previews this within the input area which seems to be a state that I do not know how to yet style. Once you click to chose the autofill option, the font-size then adjusts, however all other styles work instantly with the following
.auth input[type="text"]:-webkit-autofill,
.auth input[type="text"]:-webkit-autofill:focus {
transition: all 600000s 0s;
}
After using autofill & focus out
The focus out styles stop working IF it is an auto filled object only, you can delete and enter your own which shows the correct behaviour. Only the label is working when you focus out after autofilling.
body {
padding: 0;
margin: 0;
line-height: 24px;
font-family: "Tahoma", Helvetica, Arial;
font-size: 12px;
background: #1c1e2f;
}
*, *::before, *::after {
box-sizing: border-box;
}
* {
outline: none;
padding: 0px;
margin: 0px;
}
.container {
position: relative;
background-color: #222437;
background-clip: border-box;
border: 1px solid #313452;
border-radius: 6px;
color: white;
margin-bottom: 15px;
}
.justify-content-center {
-webkit-box-pack: center;
-moz-box-pack: center;
-ms-flex-pack: center;
justify-content: center ;
}
.d-flex {
display: -webkit-box !important;
display: -ms-flexbox !important;
display: flex !important;
}
button {
border: none;
padding: 0px;
margin: 0px;
background: none;
cursor: pointer;
}
.auth {
width: 300px;
padding: 15px;
}
.auth input[type="text"] {
display: block;
border: 1px solid #313452;
font-size: 20px;
color: #1864c9;
width: 100%;
height: 55px;
padding: 0 15px;
margin-bottom: 10px;
position: relative;
z-index: 2;
background-color: transparent;
outline: none;
border-radius: 5px;
}
.auth .inputs {
position: relative;
margin: 16px 0 0 0;
}
.auth .input-label {
position: absolute;
top: 15px;
font-size: 1.1rem;
left: 14px;
color: rgb(122, 122, 122);
font-weight: 100;
transition: 0.1s ease;
background-color: #222437;
padding: 0 5px;
}
.auth label:before { display: none; }
.auth input[type="text"]:focus ~ .input-label {
top: -12px;
color: #1864c9;
font-size: 13px;
background-color: #222437;
z-index: 2;
}
.auth input[type="text"]:target ~ .input-label {
top: -7px;
color: #1864c9;
font-size: 13px;
z-index: 2;
}
.auth input[type="text"]::placeholder { opacity: 0; }
.auth input[type="text"]:not(:placeholder-shown) { border: 2px solid rgba(26,115,232,0.25); }
.auth input[type="text"]:not(:placeholder-shown):focus { border: 2px solid rgba(26,115,232,1.00); }
.auth input[type="text"]:not(:placeholder-shown) ~ .input-label {
top: -12px;
font-size: 13px;
z-index: 2;
}
.auth input[type="text"]:not(:placeholder-shown):focus ~ .input-label { color: #1864c9; }
.auth input[type="text"]:not(:placeholder-shown) ~ .input-label { color: rgba(24,100,201,0.50); }
.auth .input:focus { border: 2px solid #1a73e8; }
.auth .link-btn {
height: 20px;
text-decoration: none;
color: #1864c9;
}
.auth .submit {
float: right;
height: 38px;
margin-top:10px;
padding: 0 25px;
border-radius: 5px;
cursor: not-allowed;
color: #313452;
border: 1px solid #313452;
}
.auth input[type="text"]:not(:placeholder-shown) ~ .submit {
background-color: #1a73e8;
color: white;
cursor: pointer;
}
.auth input[type="text"]:not(:placeholder-shown) ~ .submit:hover {
background-color: #6CA5F0;
color: #7C7C7C;
cursor: pointer;
}
.auth input[type="text"]:not(:placeholder-shown) ~ .submit:active {
background-color: #0D4186;
color: #AAAAAA;
cursor: pointer;
}
.auth input[type="text"]:-webkit-autofill,
.auth input[type="text"]:-webkit-autofill:focus {
transition: all 600000s 0s;
}
<div class="flex-row d-flex justify-content-center">
<div class="container auth">
<form method="post">
<div class="inputs">
<input type="text" name="api_key" class="input" placeholder="api key">
<label class="input-label">Enter Key</label>
<button class="submit" value="Login">Enter</button>
</div>
</form>
</div>
</div>
Edit the above snippet on CodePen
After researching autofills i found this:
https://bugs.chromium.org/p/chromium/issues/detail?id=953689
So apparently this is a known bug in chromium and other browsers, which for some reason is flagged as Won't Fix.
And if you look at the mdn:
https://developer.mozilla.org/en-US/docs/Web/CSS/:autofill
It states that this is a know problem, you can't override :-webkit-autofill !important which is set by the browser.
But since i am not happy with this answer i managed to find atleast a somewhat solution to the problem using js from another stack overflow post:
// Fix autocomplete shit
function fix_autocomplete_shit() {
setTimeout(() => {
if ($(this).is(':-internal-autofill-selected')) {
var clone = $(this).clone(true, true);
$(this).after(clone);
$(this).remove();
}
}, 10);
}
$('input').on('input', fix_autocomplete_shit);
This is a pretty shit solution, but it might help you in some way.

React and Bulma CSS - Not being able to animate modal

I am trying to implement fade-in scale effect in a Bulma CSS modal component with react and scss. It opens (gets active) when I click on a button which turns a state variable this.state.open to true as shown in the code below.
<div
className={
this.state.open
? (this.props.modalClass || 'login-modal') + ' modal is-mobile is-active'
: ' modal is-mobile'
}
id={this.props.modalId || 'login-modal'}
>
<div className={`modal-background ${this.state.open && 'modal-bg-active' }`}></div>
<div className={`modal-content ${this.state.open && 'modal-content-active'}`}>
<div ref={node => (this.wrapperRef = node)} className='modal-content-inner columns is-multiline'>
<div className='column left-content'></div>
<div className='column right-content'>
<div className='text-container'>
<div className='text-inner-container'>
.
.
.
.
I didn't add the entire markup here as in most websites I have seen the classes used for animating are modal,modal-background, and modal-content
The sass code I have written for the modal is:
.modal.login-modal {
z-index: 1000;
.modal-background {
transition: all 3s;
opacity: 0;
}
.modal-content {
background: #fff;
max-width: 840px;
width: 100%;
transform: scale(0.7);
opacity: 0;
transition: all 3s;
}
&.is-active {
visibility: visible;
.modal-background {
opacity: 1;
#include box_shadow_dark();
background-color: rgba(0, 0, 0, 0.85);
}
.modal-content {
transform: scale(1);
opacity: 1;
}
}
// .modal-background.modal-bg-active {
// visibility: visible;
// opacity: 1;
// #include box_shadow_dark();
// background-color: rgba(0, 0, 0, 0.85);
// }
// .modal-content {
// background: #fff;
// max-width: 840px;
// width: 100%;
// transform: scale(0.7);
// opacity: 0;
// transition: all 0.3s;
// }
// .modal-content.modal-content-active {
// transform: scale(1);
// opacity: 1;
// }
//==================================================> EXTRA CODE FOR CONTENT INSIDE MODAL
.left-content {
background-color: #fff;
background-image: url('https:some_url');
#include tablet_only {
display: none;
background-image: none;
}
#include mobile_only {
display: none;
background-image: none;
}
}
.right-content {
background: #fff;
.text-container {
text-align: center;
box-sizing: border-box;
#include mobile_only {
padding: 0;
}
}
.text-inner-container {
padding: 40px;
#include mobile_only {
padding: 30px;
height: auto;
}
}
}
// ==================================== Prompt
.prompt-text {
margin: 15px auto 25px;
font-size: 18px;
text-align: left;
}
// ===================================== Email OTP Fields
.user-input-field {
input {
font-size: 14px;
padding: 12px 15px;
width: 100%;
height: auto;
border-width: 2px;
}
label {
font-size: 13px;
text-align: left;
margin-bottom: 10px;
font-weight: $fontWeightBold;
}
.error-message {
font-size: 13px;
color: red;
text-align: left;
margin: 8px 0px 5px;
font-weight: $fontWeightBold;
}
}
.otp-button {
margin: 15px auto 20px;
padding: 11px 15px;
}
// ====================================== Login Buttons
.login-button {
border-radius: 4px;
padding: 13px 15px;
width: 100%;
font-size: 15px;
cursor: pointer;
height: auto;
font-weight: $fontWeightExtraBold;
#include box_shadow_dark();
}
.facebook-login-js {
display: inline-block;
color: white;
margin: 20px auto 15px;
background-color: $fbBlue;
border: none;
&:hover {
background-color: $fbBlueDark;
}
}
// google login
.google-login-js {
display: inline-block;
color: white;
margin: 0px auto 15px;
background-color: $gplusRed;
border: none;
&:hover {
background-color: $gplusRedDark;
}
}
// ========================================== Seperator
.seperator-text-container {
.seperator-text {
font-weight: $fontWeightBold;
color: #555555;
}
}
.terms-line {
font-size: 10px;
}
//=========================================================> EXTRA CODE FOR CONTENT INSIDE MODAL
}
}
What am I getting wrong here? How should I change the code for it to work? I will surely provide more details if required to understand it. Thank you!
I believe the issue is that bulma modal class has display: none property which can not be animated. Try overwriting it to display: block.
Or you could possibly use something like this https://github.com/postare/bulma-modal-fx

Button not laid out against top of relatively positioned container in Firefox

I'm building a toggle switch and the head (button) isn't positioned all the way to the top as I'd expect it to be in Firefox. Works fine in Chrome, so maybe has something to do with default browser styles?
Edit: I know how to make it work, I want to know why it happens.
codepen https://codepen.io/warhammered_cat/pen/qBZYZVy
const toggleSwitch = document.querySelector('.toggle-switch')
const toggleSwitchHead = document.querySelector('.head')
function handleToggle(e) {
toggleSwitch.classList.toggle('active')
}
toggleSwitchHead.addEventListener('click', handleToggle)
* {
box-sizing: border-box;
}
document, body {
margin: 0;
padding: 0;
}
.head {
width: 1.25rem;
height: 1.25rem;
border: 0.125rem solid gray;
border-radius: 50%;
background-color: white;
cursor: pointer;
transition: all 0.4s;
outline: none;
box-shadow: none;
}
.rail {
height: 0.75rem;
width: 100%;
background-color: gray;
border: 0.125rem solid gray;
position: absolute;
top: 0.25rem;
z-index: -1;
border-radius: 0.3rem;
transition: all 0.4s;
}
.toggle-switch {
position: relative;
height: 1.25rem;
width: 2rem;
}
.toggle-switch.active > .head {
background-color: #F7941E;
border-color: #F7841E;
transform: translateX(1rem);
}
.toggle-switch.active > .rail {
border: 0.125rem solid #F7941E;
background-color: white;
}
<div class='toggle-switch'>
<button class='head'></button>
<div class='rail'></div>
</div>
The <button> element is what is specifically being rendered differently in Firefox and Chrome.
If you change the <button> to a <div> the problem fixes itself.
The reason is that the button element is not a block element by default. You have to explicitly set the button to be a block element to get the desired behavior.
.head {
...
display: block;
...
}
try this instead,
Add display:inline-flex; to head class
.head{
display:inline-flex;
}
Click below to see codepen demo
Result :
const toggleSwitch = document.querySelector('.toggle-switch')
const toggleSwitchHead = document.querySelector('.head')
function handleToggle(e) {
toggleSwitch.classList.toggle('active')
}
toggleSwitchHead.addEventListener('click', handleToggle)
* {
box-sizing: border-box;
}
document, body {
margin: 0;
padding: 0;
}
.head {
width: 1.25rem;
height: 1.25rem;
border: 0.125rem solid gray;
border-radius: 50%;
background-color: white;
cursor: pointer;
transition: all 0.4s;
outline: none;
box-shadow: none;
display:inline-flex;
}
.rail {
height: 0.75rem;
width: 100%;
background-color: gray;
border: 0.125rem solid gray;
position: absolute;
top: 0.25rem;
z-index: -1;
border-radius: 0.3rem;
transition: all 0.4s;
}
.toggle-switch {
position: relative;
height: 1.25rem;
width: 2rem;
}
.toggle-switch.active > .head {
background-color: #F7941E;
border-color: #F7841E;
transform: translateX(1rem);
}
.toggle-switch.active > .rail {
border: 0.125rem solid #F7941E;
background-color: white;
}
<div class='toggle-switch'>
<button class='head'></button>
<div class='rail'></div>
</div>

Ionic 2 overriding sass items

I have an Ionic 2 app, that has an ion-searchbar.
<div id="search" class="search-input-keyword">
<ion-searchbar class="ion-searchtext" id="ion-searchtext" [(ngModel)]="searchQueryText" (ionFocus)="focusSearch($event)"
(change)="onChangeText($event)" (ionClear)="onCancelText($event)" (ionInput)="onInputText($event)" placeholder="{{jobType === 0 ? favourite ? 'Market Favourites' : 'Market' : favourite ? 'Postings Favourites' : 'Postings'}}"
debounce="1"></ion-searchbar>
</div>
I would like to change the input text color, and the magnifying glass icon color to #fff.
I have read here, that in order to do so, you need to change the sass variables.
I have tried the following in variables.scss:
$colors: (
primary: #009196,
secondary: #32db64,
danger: #f53d3d,
light: #f4f4f4,
dark: #222
);
$searchbar-ios-input-text-color: #fff;
$searchbar-ios-input-search-icon-color: #fff;
But there is no effect.
However, the following line does have an effect:
$text-color: #000099;
So I guess that the $searchbar-ios-input-text-color: #fff; and $searchbar-ios-input-search-icon-color: #fff; are the issue.
Question
Can anyone please advise how to change the font and icon colours?
Thanks
UPDATE
Here is some more code samples:
css
.toolbar-background-md {
background: linear-gradient(to bottom right, #00a7ad, #004547);
}
.bar-button-default-md {
color: #fff;
}
.searchbar-md .searchbar-input {
background: linear-gradient(to bottom right, #009da3, #018287);
//background-color: #009196;
}
input::-webkit-input-placeholder {
color: red ;
}
input:-moz-placeholder {
color: red ;
}
input:-ms-input-placeholder { /* IE10+ */
color: red ;
}
.toolbar-title-md {
padding: 0 12px;
font-size: 2rem;
font-weight: 500;
color: #fff;
}
.close-filters {
color: #fff;
width: 52px;
font-size: 22px;
background-color: transparent;
box-shadow: none !important;
}
.slide-fade-hide {
transition: 1s all linear;
opacity: 0;
height: 0;
position: absolute;
top: 0;
z-index: -10;
}
.slide-fade-show {
transition: all 1.2s ease-in;
opacity: 1;
height: 2em;
z-index: 1;
}
.list-md {
margin: 0px 0px 0px 0;
}
.scroll-up {
margin-top: 20px;
}
.menu-title {
padding: 1px 95px 1px 10px;
}
.menu-toolbar {
padding: 35px;
}
.menu-content {
position: relative !important;
}
.item-search-wanted {
padding-left: 1px;
}
.item-search-offered {
padding-left: 1px;
}
.job-content-offered {
background-color: white !important;
}
.job-content-wanted {
background-color: white !important;
}
.search-button-star {
background-color: #009196;
}
.search-input-keyword {
width: 125%;
display: flex;
}
.search-input {
width: 125%;
}
.toolbar-content {
display: flex;
}
.extra-search-col {
padding: 0px;
}
ion-col {
padding: 2px;
}
ion-title {
z-index: 11;
}
ion-avatar img {
border-radius: 2.8rem;
max-height: 5.6rem;
max-width: 5.6rem;
}
.small-text-search {
font-size: 75% !important;
color: grey !important;
padding-top: 4px;
}
.small-text-search-desc {
font-size: 85%;
}
.small-text-search-rating {
padding-top: inherit;
padding-left: inherit;
}
.small-text-search-starrating {
padding-top: 2px;
font-size: 100% ! important;
}
.search-category {
float: right;
}
.job-tite {
width: 250px;
}
.job-timestamp {
white-space: nowrap;
}
.search-rating {
float: left;
}
.search-popover-button {
width: 75px;
height: 75px;
}
.button-icon-only ion-icon.search-popover-icon {
font-size: 2.8em;
}
.filter-image {
-webkit-filter : hue-rotate(-30deg) opacity(100%);
filter : hue-rotate(-30deg) opacity(100%);
}
.icon-text {
padding-left: 5px;
padding-bottom: 3px;
}
.icon-text-no {
padding-left: 5px;
}

Stop :after element from jumping to the next row on wrap

I have some beautiful CSS:
$itemHeight: 40px;
$arrowModifier: 8;
$pageBackgroundColor: $color-gray-50;
.processBar {
display: flex;
flex-wrap: wrap;
&_item {
display: inline-block;
background: $color-gray-200;
height: $itemHeight;
position: relative;
flex-grow: 1;
text-align: center;
line-height: $itemHeight;
text-decoration: none;
color: $color-text;
padding-left: 10px;
padding-right: 10px;
&:hover {
text-decoration: none;
color: $color-text;
}
&-default {
&:hover {
background: $color-light-gray;
}
}
&-selected {
background: $color-white;
}
&:before,
&:after {
display: inline-block;
content: "";
border-style: solid;
position: absolute;
}
&:first-child {
&:before {
left:0;
border: none;
}
}
&:not(:first-child) {
&:before {
left:0;
border-color: transparent transparent transparent $pageBackgroundColor;
border-width: $itemHeight/2 0 $itemHeight/2 $itemHeight/$arrowModifier;
}
}
&:last-child {
&:after {
right: 0;
border: none;
}
}
&:not(:last-child) {
&:after {
right:0;
border-color: $pageBackgroundColor transparent;
border-width: $itemHeight/2 0 $itemHeight/2 $itemHeight/$arrowModifier;
}
}
}
}
Here is the HTML that uses it:
<div class="processBar">
Label
Label
Label
Label
Label
Label
</div>
Here is what it does:
But at a certain size the :after elements can jump down, as seen here:
I don't understand why that is happening. How can I stop it from happening?
The ::before and ::after pseudo-elements on a flex container are considered flex items.
The ::before pseudo is the first item. The ::after pseudo is the last. So you have to think of them as siblings of the other flex items.
You can try using the order property to re-arrange items to achieve the effect you want.
What CSS pre-processor is this? I used every pre-compiler on CodePen and got errors from the $variables so I removed them and filled them in with whatever. Is this Stylus? Anyways, besides the variables being removed and some color changes, the only significant change is that I changed flex-wrap:wrap to flex-wrap:nowrap.
SNIPPET
.processBar {
display: flex;
flex-wrap: nowrap;
}
.processBar_item {
display: inline-block;
background: #c8c8c8;
height: 40px;
position: relative;
flex-grow: 1;
text-align: center;
line-height: 40px;
text-decoration: none;
color: #000;
padding-left: 10px;
padding-right: 10px;
}
.processBar_item:hover {
text-decoration: none;
color: red;
}
.processBar_item-default:hover {
background: #808080;
}
.processBar_item-selected {
background: cyan;
}
.processBar_item:before,
.processBar_item:after {
display: inline-block;
content: "";
border-style: solid;
position: absolute;
}
.processBar_item:first-child:before {
left: 0;
border: none;
}
.processBar_item:not(:first-child):before {
left: 0;
border-color: red;
border-width: 20px 0 20px 5px;
}
.processBar_item:last-child:after {
right: 0;
border: none;
}
.processBar_item:not(:last-child):after {
right: 0;
border-color: tomato;
border-width: 20px 0 20px 5px;
}
<div class="processBar">
Label
Label
Label
Label
Label
Label
</div>

Resources