blob: c773d5340ff0fdddd284823351486271ba97e571 [file] [log] [blame]
@charset "utf-8";
@import "../util";
$left-padding: 4em; // 32pt; // 2.8em;
$border-size: 2px;
$bracket-size: .4em; // 4pt;
/**
* Virtual Collection Builder
*/
.vc {
margin-top: 4pt;
/**
* Rules for all docGroups
*/
.docGroup {
position: relative;
display: inline-block;
margin-left: $left-padding; // 28pt
.docGroup { display: block; }
color: $nearly-white;
padding: 4pt 2pt 4pt 0pt;
border: {
radius: $standard-border-radius * 2;
style: solid;
width: 0 $bracket-size; // .6em .5em
}
// Whiten on hover
&:hover {
background-color: rgba(255,255,255,.06);
}
&[data-operation] {
> .doc:first-child::before,
> .docGroup:first-child::before {
content: none;
}
> .doc::before,
> .docGroup::before {
display: inline-block;
position: absolute;
text-align: right;
width: $left-padding;
margin-left: -1 * ($left-padding + .5em); // -28pt
color: $dark-green;
line-height: 1.5em;
border-top: $border-size solid transparent;
}
> .docGroup::before {
margin-left: -1 * ($left-padding + .5em) + (-1 * $bracket-size);
}
}
// Or operation
&[data-operation=or] {
border-color: $dark-orange;
> .doc::before,
> .docGroup::before {
// This will be overruled by JS!
content: "or";
}
}
// And operation
&[data-operation=and] {
> .doc::before,
> .docGroup::before {
// This will be overruled by JS!
content: "and";
}
}
/**
* All operators on groups
*/
> .operators {
position: absolute;
display: block;
top: 10px;
vertical-align: middle;
left: 3px;
> span:first-child {
border: {
top-left-radius: 0;
bottom-left-radius: 0;
}
}
margin-left: 100%;
padding: 0;
}
}
/**
* All document rules
*/
.doc {
padding-left: $left-padding;
> span + span,
> span + div + span {
margin-left: 5pt;
}
> span.key,
> span.value {
font-weight: bold;
&[data-type=regex] {
font-style: italic;
&::after, &::before {
content: '/';
}
}
}
/**
* All operators on docs
*/
> .operators {
display: inline-block;
margin-left: 10px;
}
> span.key {
position: relative;
> ul {
margin: 0;
margin-left: 3.3em;
}
}
}
.rewritten {
.rewrite {
margin-left: 4pt;
display: inline-block;
color: $dark-orange;
&::after {
font: {
family: FontAwesome;
style: normal;
weight: normal;
}
content: $fa-rewrite;
text-decoration: underline;
}
span {
display: none;
}
}
}
.doc > span {
cursor: pointer;
&:hover {
color: $dark-green;
}
}
/**
* All operators
*/
.operators {
opacity: 0;
white-space: nowrap;
padding: 0;
font-size: 0;
line-height: 0;
text-align: center;
> span {
box-shadow: $choose-box-shadow;
cursor: pointer;
font-size: 9pt;
line-height: 1.5em;
padding: 0 4px;
display: inline-block;
@include choose-item;
border-style: solid;
border-width: $border-size 0;
&:hover {
@include choose-hover;
}
&:first-child {
border: {
left-width: $border-size;
top-left-radius: $standard-border-radius;
bottom-left-radius: $standard-border-radius;
}
}
&:last-child {
border: {
right-width: $border-size;
top-right-radius: $standard-border-radius;
bottom-right-radius: $standard-border-radius;
}
}
}
}
> .docGroup {
margin-left: 0;
}
.doc, .docGroup {
&:hover > .operators {
opacity: 1;
}
}
.menu {
display: inline-block;
}
div.value {
position: absolute;
display: inline-block;
z-index: 8000;
@include choose-item;
box-shadow: $choose-box-shadow;
padding: 4pt;
margin-top: -6pt;
border: {
width: $border-size;
style: solid;
radius: $standard-border-radius;
}
input {
border-width: 0;
}
> div {
padding: 2pt;
cursor: pointer;
font: {
size: 80%;
style: italic;
}
display: inline-block;
@include choose-item;
border: {
width: $border-size;
style: solid;
radius: $standard-border-radius;
}
&:hover {
@include choose-hover;
}
}
&.regex {
> input {
font-style: italic;
}
> div {
@include choose-active;
}
}
}
}
/**
* The z-index cascade for groups.
*/
$dg-index : 30;
.docGroup {
> .operators {
z-index: $dg-index;
}
.docGroup {
> .operators {
z-index: $dg-index + 1;
}
.docGroup {
> .operators {
z-index: $dg-index + 2;
}
.docGroup {
> .operators {
z-index: $dg-index + 3;
}
.docGroup {
> .operators {
z-index: $dg-index + 4;
}
.docGroup {
> .operators {
z-index: $dg-index + 5;
}
.docGroup {
> .operators {
z-index: $dg-index + 6;
}
}
}
}
}
}
}
}
#collection {
line-height: 1em;
border-radius: $standard-border-radius;
}
#vc-choose > span.rewritten {
&::after {
color: $dark-orange;
padding: 0;
padding-left: 4px;
font: {
family: FontAwesome;
style: normal;
weight: normal;
}
content: $fa-rewrite;
text-decoration: underline;
}
}