Skip to content

Instantly share code, notes, and snippets.

@alex-kinokon
Last active December 15, 2016 04:06
Show Gist options
  • Save alex-kinokon/7693a392636c8d1c9677bb59cd700884 to your computer and use it in GitHub Desktop.
Save alex-kinokon/7693a392636c8d1c9677bb59cd700884 to your computer and use it in GitHub Desktop.
import { borderRadius, clearfix } from '../mixin';
import { breadcrumb } from '../constants';
export default {
.breadcrumb {
padding: `${breadcrumb.padding.y} ${breadcrumb.padding.x}`;
margin-bottom: `${spacer.y}`;
list-style: none;
background-color: `${breadcrumb.bg}`;
... borderRadius(borderRadius);
... clearfix;
}
.breadcrumb-item {
float: left;
// The separator between breadcrumbs (by default, a forward-slash: "/")
+ .breadcrumb-item::before {
display: inline-block; // Suppress underlining of the separator in modern browsers
padding-right: `${breadcrumb.item.padding}`;
padding-left: `${breadcrumb.item.padding}`;
color: `${breadcrumb.divider.color}`;
content: `${breadcrumb.divider}`;
}
// IE9-11 hack to properly handle hyperlink underlines for breadcrumbs built
// without `<ul>`s. The `::before` pseudo-element generates an element
// *within* the .breadcrumb-item and thereby inherits the `text-decoration`.
//
// To trick IE into suppressing the underline, we give the pseudo-element an
// underline and then immediately remove it.
+ .breadcrumb-item:hover::before {
text-decoration: underline;
}
+ .breadcrumb-item:hover::before {
text-decoration: none;
}
&.active {
color: `${breadcrumb.active.color}`;
}
}
}
import { borderRadius, clearfix } from '../mixin';
import { breadcrumb } from '../constants';
export default {
.breadcrumb {
padding: [ breadcrumb.padding.y, breadcrumb.padding.x ],
margin-bottom: { spacer.y },
list-style: 'none',
background-color: `${breadcrumb.bg}`,
... borderRadius(borderRadius),
... clearfix,
}
.breadcrumb-item {
float: left;
const next = '+ .breadcrumb-item';
// The separator between breadcrumbs (by default, a forward-slash: "/")
{next}::before {
display: inline-block, // Suppress underlining of the separator in modern browsers
padding-right: { breadcrumb.item.padding },
padding-left: { breadcrumb.item.padding },
color: { breadcrumb.divider.color },
content: { breadcrumb.divider },
}
// IE9-11 hack to properly handle hyperlink underlines for breadcrumbs built
// without `<ul>`s. The `::before` pseudo-element generates an element
// *within* the .breadcrumb-item and thereby inherits the `text-decoration`.
//
// To trick IE into suppressing the underline, we give the pseudo-element an
// underline and then immediately remove it.
{next}:hover::before {
text-decoration: underline,
}
{next}:hover::before {
text-decoration: none,
}
&.active {
color: {breadcrumb.active.color},
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment