n8n/packages/design-system/theme/src/tabs.scss
Mutasem Aldmour 5bd8f7c93e
Implement design system (#2050)
* split up main, sass imports, import new nds

* migrate most buttons

* update sizes based on feedback

* update copy buttons

* update executions list

* fix issues

* force message box buttons

* update warning color

* update more buttons

* wrap message box buttons

* update last component

* lint fixes

* add build report step

* breakout imports

* set package.json

* fix notification bug

* clean up imports

* use build directories directly

* update imports

* remove xl size

* update number inputs

* fix input width

* update line height, fix icon bug

* fix up editor

* fix spacing between buttons

* Reset line height

* revert changes to this

* revert changes

* clean up button sizes

* change to outline

* update select height

* update tooltip

* remove build report step

* clean up impl

* remove regenerator runtime

* add design system repo

* apply editorconfig

* apply editor config prettier

* lint issue

* switch to tabs

* switch to single space

* update eslintrc

* remove git modules

* update sass package

* support dart sass

* add build

* update dependency

* update contributing.md

* set repo

* update versions

* add tslint step

* update spacing to spaces, add dev step

* add test step

* add test step

* update browser lint rc

* remove .github

* delete .gitignore

* set comment for icons

* remove preview link

* update button interface

* update types

* set types

* clean up intro

* update intro

* remove assets

* move into preview

* remove headline comment

* reduce theme build

* loading executions

* match deps versions

* match deps versions

* fix lint issues

* fix lint issues

* update callback

* disable codacy for docs.css

* fix storybook issues

* add design system to docker image

* update spacing around delete sort button

* set line height to stop juggling headline

* update sizes

* clean up vars

* fix scss issues

* update button vars

* add shade color

* fix button without click

* fix buttons bug

* fix bug with executions list

* clean up theme

* update link styling

* fix typo

* run prettier

* 🎨 code format

* 🎨 code format

* 🔥 remove empty files

*  N8n 2284 new inputs (#2075)

* implement inputs

* prettier fixes

* revert unnessary change

* move input components and tooltip

* remove form elements

* move select

* update input placements

* update sizes

* update credentails

* clean up select size

* fix caret issue

* update inputs

* clean up select

* fix tags dropdown border

* clean up tags input

* fix workflow name bug

* clean up select here

* add sizes template

* fix option caret

* fix input sizes

* update date input size

* remove tags input override

* update prop

* update input size

* center run data inputs

* update disabled colors

* update execution header

* update scrollbar

* update text area spacing

* fix items in header

* update run data tooltip

* remove popover

* update prefix positions

* add filterable demo

* address design issues

* fix input issues, flip boolean input to text

* update input sufffix colors

* remove override

* speed up switch, fix toggle spacing issue

* update icon

* remove icon classes

* clean up inputs

* clean up inputs with icons

* update input spacing again

* update suffix position

* build

* Add support for xlarge inputs

* fix input issues

* fix input issue

* update listeners

* update number inputs for settings

* update append/prepend spacing

* clean up inputs, set expression input as text

* fix type errors

* fix workflow number input

* fix tags dropdown bug

* fix bugs

* fix menu item bug

* remove font weight from link element

* remove default

* fix select option

* fix contrast issues

* allow overflow x for multi selects

* fix icon

* update options select

* fix issue that resolves expression to null

* update how actions are centered

* fix up selects

* update selects to support limiting size

* update option styles

*  Apply suggestions BHesseldieck

Co-authored-by: Ben Hesseldieck <1849459+BHesseldieck@users.noreply.github.com>

* 🎨 code format

Co-authored-by: Jan <janober@users.noreply.github.com>
Co-authored-by: Ben Hesseldieck <1849459+BHesseldieck@users.noreply.github.com>
Co-authored-by: Ben Hesseldieck <b.hesseldieck@gmail.com>

*  Revert "🔥 remove empty files"

This reverts commit e91ace4e52.

*  Remove private from n8n-design-system package

* 🎨 Change to spaces to stay consistent with editorconfig & others
package files

*  Fix year in license

Co-authored-by: Ben Hesseldieck <1849459+BHesseldieck@users.noreply.github.com>
Co-authored-by: Ben Hesseldieck <b.hesseldieck@gmail.com>
Co-authored-by: Jan <janober@users.noreply.github.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2021-08-29 13:36:17 +02:00

607 lines
12 KiB
SCSS

@use "mixins/mixins";
@use "./common/var";
@include mixins.b(tabs) {
@include mixins.e(header) {
padding: 0;
position: relative;
margin: 0 0 15px;
}
@include mixins.e(active-bar) {
position: absolute;
bottom: 0;
left: 0;
height: 2px;
background-color: var(--color-primary);
z-index: 1;
transition: transform 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
list-style: none;
}
@include mixins.e(new-tab) {
float: right;
border: 1px solid #d3dce6;
height: 18px;
width: 18px;
line-height: 18px;
margin: 12px 0 9px 10px;
border-radius: 3px;
text-align: center;
font-size: 12px;
color: #d3dce6;
cursor: pointer;
transition: all 0.15s;
.el-icon-plus {
transform: scale(0.8, 0.8);
}
&:hover {
color: var(--color-primary);
}
}
@include mixins.e(nav-wrap) {
overflow: hidden;
margin-bottom: -1px;
position: relative;
&::after {
content: '';
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 2px;
background-color: var(--border-color-base);
z-index: var.$index-normal;
}
@include mixins.when(scrollable) {
padding: 0 20px;
box-sizing: border-box;
}
}
@include mixins.e(nav-scroll) {
overflow: hidden;
}
@include mixins.e((nav-next, nav-prev)) {
position: absolute;
cursor: pointer;
line-height: 44px;
font-size: 12px;
color: var(--color-text-light);
}
@include mixins.e(nav-next) {
right: 0;
}
@include mixins.e(nav-prev) {
left: 0;
}
@include mixins.e(nav) {
white-space: nowrap;
position: relative;
transition: transform 0.3s;
float: left;
z-index: #{var.$index-normal + 1};
@include mixins.when(stretch) {
min-width: 100%;
display: flex;
& > * {
flex: 1;
text-align: center;
}
}
}
@include mixins.e(item) {
padding: 0 20px;
height: 40px;
box-sizing: border-box;
line-height: 40px;
display: inline-block;
list-style: none;
font-size: 14px;
font-weight: 500;
color: var(--color-text-dark);
position: relative;
&:focus,
&:focus:active {
outline: none;
}
&:focus.is-active.is-focus:not(:active) {
box-shadow: 0 0 2px 2px var(--color-primary) inset;
border-radius: 3px;
}
& .el-icon-close {
border-radius: 50%;
text-align: center;
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
margin-left: 5px;
&:before {
transform: scale(0.9);
display: inline-block;
}
&:hover {
background-color: var(--color-text-lighter);
color: var.$color-white;
}
}
@include mixins.when(active) {
color: var(--color-primary);
}
&:hover {
color: var(--color-primary);
cursor: pointer;
}
@include mixins.when(disabled) {
color: var.$disabled-color-base;
cursor: default;
}
}
@include mixins.e(content) {
overflow: hidden;
position: relative;
}
@include mixins.m(card) {
> .el-tabs__header {
border-bottom: 1px solid var(--border-color-base);
}
> .el-tabs__header .el-tabs__nav-wrap::after {
content: none;
}
> .el-tabs__header .el-tabs__nav {
border: 1px solid var(--border-color-base);
border-bottom: none;
border-radius: 4px 4px 0 0;
box-sizing: border-box;
}
> .el-tabs__header .el-tabs__active-bar {
display: none;
}
> .el-tabs__header .el-tabs__item .el-icon-close {
position: relative;
font-size: 12px;
width: 0;
height: 14px;
vertical-align: middle;
line-height: 15px;
overflow: hidden;
top: -1px;
right: -2px;
transform-origin: 100% 50%;
}
> .el-tabs__header .el-tabs__item {
border-bottom: 1px solid transparent;
border-left: 1px solid var(--border-color-base);
transition: color 0.3s cubic-bezier(0.645, 0.045, 0.355, 1),
padding 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
&:first-child {
border-left: none;
}
&.is-closable {
&:hover {
padding-left: 13px;
padding-right: 13px;
& .el-icon-close {
width: 14px;
}
}
}
&.is-active {
border-bottom-color: var.$color-white;
&.is-closable {
padding-left: 20px;
padding-right: 20px;
.el-icon-close {
width: 14px;
}
}
}
}
}
@include mixins.m(border-card) {
background: var.$color-white;
border: 1px solid var(--border-color-base);
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), 0 0 6px 0 rgba(0, 0, 0, 0.04);
> .el-tabs__content {
padding: 15px;
}
> .el-tabs__header {
background-color: var.$background-color-base;
border-bottom: 1px solid var(--border-color-base);
margin: 0;
}
> .el-tabs__header .el-tabs__nav-wrap::after {
content: none;
}
> .el-tabs__header .el-tabs__item {
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
border: 1px solid transparent;
margin-top: -1px;
color: var(--color-text-light);
&:first-child {
margin-left: -1px;
}
& + .el-tabs__item {
margin-left: -1px;
}
&.is-active {
color: var(--color-primary);
background-color: var.$color-white;
border-right-color: var(--border-color-base);
border-left-color: var(--border-color-base);
}
&:not(.is-disabled):hover {
color: var(--color-primary);
}
&.is-disabled {
color: var.$disabled-color-base;
}
}
> .el-tabs__header .is-scrollable .el-tabs__item:first-child {
margin-left: 0;
}
}
@include mixins.m((top, bottom)) {
.el-tabs__item.is-top:nth-child(2),
.el-tabs__item.is-bottom:nth-child(2) {
padding-left: 0;
}
.el-tabs__item.is-top:last-child,
.el-tabs__item.is-bottom:last-child {
padding-right: 0;
}
&.el-tabs--border-card,
&.el-tabs--card,
.el-tabs--left,
.el-tabs--right {
> .el-tabs__header {
.el-tabs__item:nth-child(2) {
padding-left: 20px;
}
.el-tabs__item:last-child {
padding-right: 20px;
}
}
}
}
@include mixins.m(bottom) {
.el-tabs__header.is-bottom {
margin-bottom: 0;
margin-top: 10px;
}
&.el-tabs--border-card {
.el-tabs__header.is-bottom {
border-bottom: 0;
border-top: 1px solid var(--border-color-base);
}
.el-tabs__nav-wrap.is-bottom {
margin-top: -1px;
margin-bottom: 0;
}
.el-tabs__item.is-bottom:not(.is-active) {
border: 1px solid transparent;
}
.el-tabs__item.is-bottom {
margin: 0 -1px -1px -1px;
}
}
}
@include mixins.m((left, right)) {
overflow: hidden;
.el-tabs__header.is-left,
.el-tabs__header.is-right,
.el-tabs__nav-wrap.is-left,
.el-tabs__nav-wrap.is-right,
.el-tabs__nav-scroll {
height: 100%;
}
.el-tabs__active-bar.is-left,
.el-tabs__active-bar.is-right {
top: 0;
bottom: auto;
width: 2px;
height: auto;
}
.el-tabs__nav-wrap.is-left,
.el-tabs__nav-wrap.is-right {
margin-bottom: 0;
> .el-tabs__nav-prev,
> .el-tabs__nav-next {
height: 30px;
line-height: 30px;
width: 100%;
text-align: center;
cursor: pointer;
i {
transform: rotateZ(90deg);
}
}
> .el-tabs__nav-prev {
left: auto;
top: 0;
}
> .el-tabs__nav-next {
right: auto;
bottom: 0;
}
&.is-scrollable {
padding: 30px 0;
}
&::after {
height: 100%;
width: 2px;
bottom: auto;
top: 0;
}
}
.el-tabs__nav.is-left,
.el-tabs__nav.is-right {
float: none;
}
.el-tabs__item.is-left,
.el-tabs__item.is-right {
display: block;
}
}
@include mixins.m(left) {
.el-tabs__header.is-left {
float: left;
margin-bottom: 0;
margin-right: 10px;
}
.el-tabs__nav-wrap.is-left {
margin-right: -1px;
&::after {
left: auto;
right: 0;
}
}
.el-tabs__active-bar.is-left {
right: 0;
left: auto;
}
.el-tabs__item.is-left {
text-align: right;
}
&.el-tabs--card {
.el-tabs__active-bar.is-left {
display: none;
}
.el-tabs__item.is-left {
border-left: none;
border-right: 1px solid var(--border-color-base);
border-bottom: none;
border-top: 1px solid var(--border-color-base);
text-align: left;
}
.el-tabs__item.is-left:first-child {
border-right: 1px solid var(--border-color-base);
border-top: none;
}
.el-tabs__item.is-left.is-active {
border: 1px solid var(--border-color-base);
border-right-color: #fff;
border-left: none;
border-bottom: none;
&:first-child {
border-top: none;
}
&:last-child {
border-bottom: none;
}
}
.el-tabs__nav {
border-radius: 4px 0 0 4px;
border-bottom: 1px solid var(--border-color-base);
border-right: none;
}
.el-tabs__new-tab {
float: none;
}
}
&.el-tabs--border-card {
.el-tabs__header.is-left {
border-right: 1px solid #dfe4ed;
}
.el-tabs__item.is-left {
border: 1px solid transparent;
margin: -1px 0 -1px -1px;
&.is-active {
border-color: transparent;
border-top-color: rgb(209, 219, 229);
border-bottom-color: rgb(209, 219, 229);
}
}
}
}
@include mixins.m(right) {
.el-tabs__header.is-right {
float: right;
margin-bottom: 0;
margin-left: 10px;
}
.el-tabs__nav-wrap.is-right {
margin-left: -1px;
&::after {
left: 0;
right: auto;
}
}
.el-tabs__active-bar.is-right {
left: 0;
}
&.el-tabs--card {
.el-tabs__active-bar.is-right {
display: none;
}
.el-tabs__item.is-right {
border-bottom: none;
border-top: 1px solid var(--border-color-base);
}
.el-tabs__item.is-right:first-child {
border-left: 1px solid var(--border-color-base);
border-top: none;
}
.el-tabs__item.is-right.is-active {
border: 1px solid var(--border-color-base);
border-left-color: #fff;
border-right: none;
border-bottom: none;
&:first-child {
border-top: none;
}
&:last-child {
border-bottom: none;
}
}
.el-tabs__nav {
border-radius: 0 4px 4px 0;
border-bottom: 1px solid var(--border-color-base);
border-left: none;
}
}
&.el-tabs--border-card {
.el-tabs__header.is-right {
border-left: 1px solid #dfe4ed;
}
.el-tabs__item.is-right {
border: 1px solid transparent;
margin: -1px -1px -1px 0;
&.is-active {
border-color: transparent;
border-top-color: rgb(209, 219, 229);
border-bottom-color: rgb(209, 219, 229);
}
}
}
}
}
.slideInRight-transition,
.slideInLeft-transition {
display: inline-block;
}
.slideInRight-enter {
animation: slideInRight-enter 0.3s;
}
.slideInRight-leave {
position: absolute;
left: 0;
right: 0;
animation: slideInRight-leave 0.3s;
}
.slideInLeft-enter {
animation: slideInLeft-enter 0.3s;
}
.slideInLeft-leave {
position: absolute;
left: 0;
right: 0;
animation: slideInLeft-leave 0.3s;
}
@keyframes slideInRight-enter {
0% {
opacity: 0;
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
-webkit-transform: translateX(100%);
transform: translateX(100%);
}
to {
opacity: 1;
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
-webkit-transform: translateX(0);
transform: translateX(0);
}
}
@keyframes slideInRight-leave {
0% {
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
-webkit-transform: translateX(0);
transform: translateX(0);
opacity: 1;
}
100% {
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
-webkit-transform: translateX(100%);
transform: translateX(100%);
opacity: 0;
}
}
@keyframes slideInLeft-enter {
0% {
opacity: 0;
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
-webkit-transform: translateX(-100%);
transform: translateX(-100%);
}
to {
opacity: 1;
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
-webkit-transform: translateX(0);
transform: translateX(0);
}
}
@keyframes slideInLeft-leave {
0% {
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
-webkit-transform: translateX(0);
transform: translateX(0);
opacity: 1;
}
100% {
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
-webkit-transform: translateX(-100%);
transform: translateX(-100%);
opacity: 0;
}
}