open-consul/ui-v2/app/styles/components/discovery-chain/skin.scss

127 lines
2.7 KiB
SCSS
Raw Normal View History

ui: Discovery Chain (#6746) * Add data layer for discovery chain (model/adapter/serializer/repo) * Add routing plus template for routing tab * Add extra deps - consul-api-double upgrade plus ngraph for graphing * Add discovery-chain and related components and helpers: 1. discovery-chain to orchestrate/view controller 2. route-card, splitter-card, resolver card to represent the 3 different node types. 3. route-match helper for easy formatting of route rules 4. dom-position to figure out where things are in order to draw lines 5. svg-curve, simple wrapper around svg's <path d=""> attribute format. 6. data-structs service. This isn't super required but we are using other data-structures provided by other third party npm modules in other yet to be merged PRs. All of these types of things will live here for easy access/injection/changability 7. Some additions to our css-var 'polyfill' for a couple of extra needed rules * Related CSS for discovery chain 1. We add a %card base component here, eventually this will go into our base folder and %stats-card will also use it for a base component. 2. New icon for failovers * ui: Discovery Chain Continued (#6939) 1. Add in the things we use for the animations 2 Use IntersectionObserver so we know when the tab is visible, otherwise the dom-position helper won't work as the dom elements don't have any display. 3. Add some base work for animations and use them a little 4. Try to detect if a resolver is a redirect. Right now this works for datacenters and namespaces, but it can't work for services and subsets - we are awaiting backend support for doing this properly. 5. Add a fake 'this service has no routes' route that says 'Default' 6. redirect icon 7. Add CSS.escape polyfill for Edge
2019-12-17 19:27:28 +00:00
/* CSS active states are partly added at the top of */
/* components/templates/discovery-chain.hbs for reasons */
/* the styling there almost 100% uses our CSS vars */
/* defined in our CSS files, but be sure to */
/* take a look in the discovery-chain.hbs */
%discovery-chain .tooltip,
%chain-group > header span {
@extend %with-tooltip;
}
%route-card > header ul li {
@extend %pill;
}
%discovery-chain-tween {
transition-duration: 0.1s;
transition-timing-function: linear;
}
%discovery-chain-edge,
%chain-node {
cursor: pointer;
}
%discovery-chain-edge {
@extend %discovery-chain-tween;
transition-property: stroke;
fill: none;
stroke: $gray-400;
stroke-width: 2;
vector-effect: non-scaling-stroke;
}
%discovery-chain.active [id*=':'],
%chain-node-inactive,
%discovery-chain-edge-inactive {
opacity: 0.5;
}
%chain-node,
%chain-node a {
color: $gray-900 !important;
}
%discovery-chain-edge-active {
stroke: $gray-900;
}
%chain-group {
border-radius: $decor-radius-100;
border: 1px solid $gray-200;
background-color: $gray-100;
pointer-events: none;
}
%chain-group > header span,
%chain-node {
pointer-events: all;
}
%chain-group > header > * {
text-transform: uppercase;
border: 0;
font-size: 12px;
font-weight: normal;
}
%chain-group > header span::after {
@extend %with-info-circle-outline-icon, %as-pseudo;
width: 1.2em;
height: 1.2em;
opacity: 0.6;
}
/* TODO: this is tooltip related, we also do this elsewhere */
/* so would be good to look and see if we can centralize this */
%chain-group > header span em {
text-transform: none;
width: 250px;
font-style: normal;
white-space: normal !important;
}
%chain-node {
@extend %discovery-chain-tween;
transition-property: opacity background-color border-color;
}
%chain-node-active {
opacity: 1;
background-color: $white;
border-color: $gray-500;
}
/* TODO: More text truncation, centralize */
%route-card header:not(.short) dd {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
/* Icons */
%route-card section header > * {
visibility: hidden;
}
%resolver-card dt,
%route-card section header > *::before {
background-color: $gray-100;
visibility: visible;
}
%route-card .match-headers header *::before {
content: 'H';
}
%route-card .match-queryparams header > *::before {
content: 'Q';
}
%resolver-card dt {
font-size: 0;
background-size: 80% 80%;
}
%resolver-card dl.failover dt {
@extend %with-cloud-cross-icon;
}
%resolver-card dl.redirect dt {
@extend %with-redirect-icon;
}
/**/
%with-chain-outlet::before {
@extend %as-pseudo;
background-color: $white;
border-radius: $decor-radius-full;
border: 2px solid $gray-400;
}
%discovery-chain circle {
stroke-width: 2;
stroke: $gray-400;
fill: $white;
}