Skip to content

Commit

Permalink
Move tabs style to global scope
Browse files Browse the repository at this point in the history
  • Loading branch information
caleeli committed Feb 28, 2024
1 parent df297ef commit 5320504
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 121 deletions.
1 change: 1 addition & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ import controlConfig from "./form-builder-controls";
import globalProperties from "./global-properties";
import "bootstrap";
import "./assets/css/tabs.css";
// To include another language in the Validator with variable processmaker
const globalObject = typeof window === "undefined" ? global : window;
Expand Down
118 changes: 118 additions & 0 deletions src/assets/css/tabs.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
/* Setup some colors */
:root {
--tabs-blue: #1572c2;
--tabs-light: #c3c9cf;
--tabs-grey: #6a7888;
--tabs-border: #cdddee;
--tabs-scroll-bg: #ebeef2;
--tabs-white: #ffffff;
}
/* Override Bootstrap default tab styles */
.nav-tabs {
border-bottom: 1px solid var(--tabs-border) !important;
flex-wrap: nowrap !important;
overflow: hidden !important;
}

.nav-tabs .nav-item .nav-link {
display: flex;
align-items: center;
}

/* Style for individual tabs */
.nav-tabs .nav-item.show .nav-link,
.nav-tabs .nav-link.active {
border: none;
box-shadow: inset 0 -3px 0 0 var(--tabs-blue) !important; /* This sets the blue bottom border for the active tab */
background-color: var(
--tabs-white
); /* This sets the background color for the active tab */
border-radius: 0 !important; /* This removes the border-radius */
color: var(--tabs-blue) !important;
position: relative;
}

/* Style for non-active tabs */
.nav-tabs .nav-link {
border: 1px solid var(--tabs-border) !important;
color: var(--tabs-grey); /* This sets the text color for the inactive tabs */
border-radius: 0 !important; /* This ensures no border radius for a flat design */
padding: 0.5rem 1rem;
margin-right: -1px;
text-wrap: nowrap !important;
flex-wrap: nowrap !important;
}

.nav-tabs .nav-item .nav-link:not(.active) {
.badge {
background-color: #6A7888 !important;
}

span:not(.badge, .close-tab) {
color: #556271 !important;
}
}

/* Style for the hover effect */
.nav-tabs .nav-link:hover {
border: none;
background-color: var(
--tabs-white
); /* This changes the background color when hovering */
}

/* Adding the 'x' button to the tab */
.nav-tabs .nav-link .close-tab {
font-size: 0.8rem;
color: var(--tabs-light);
margin-left: 0.5rem;
display: inline !important;
}

/* Style adjustments for the 'x' button */
.nav-tabs .nav-link .close-tab:hover {
color: var(--tabs-grey);
cursor: pointer;
}
.nav-tabs .nav-scroll {
position: absolute;
top: calc(50% - 0.75rem);
width: 1.5rem;
height: 1.5rem;
font-size: 0.75rem;
display: flex;
align-items: center;
justify-content: center;
background-color: var(--tabs-scroll-bg);
color: var(--tabs-grey);
cursor: pointer;
border: 1px solid var(--tabs-border);
border-radius: 100%;
z-index: 1;
}
.nav-tabs .nav-scroll-right {
right: 5px;
}
.nav-tabs .nav-scroll-left {
margin-left: 5px;
}
.nav-tabs .tabs-sticky {
position: sticky;
-webkit-position: sticky;
left: 0;
right: 0;
z-index: 2;
}
.nav-tabs .tabs-start {
background-color: var(--tabs-white);
}
/* add margin right to the last li element to hide safely the right scroll button */
.nav-tabs li.nav-item:last-of-type {
margin-right: 2rem;
}
.flat-tabs .h-tab {
height: calc(100% - 42px) !important;
}
.dd-ml {
margin-left: 2rem;
}
121 changes: 0 additions & 121 deletions src/components/TabsBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -231,124 +231,3 @@ export default {
}
};
</script>

<style>
/* Setup some colors */
:root {
--tabs-blue: #1572c2;
--tabs-light: #c3c9cf;
--tabs-grey: #6a7888;
--tabs-border: #cdddee;
--tabs-scroll-bg: #ebeef2;
--tabs-white: #ffffff;
}
/* Override Bootstrap default tab styles */
.nav-tabs {
border-bottom: 1px solid var(--tabs-border) !important;
flex-wrap: nowrap !important;
overflow: hidden !important;
}
.nav-tabs .nav-item .nav-link {
display: flex;
align-items: center;
}
/* Style for individual tabs */
.nav-tabs .nav-item.show .nav-link,
.nav-tabs .nav-link.active {
border: none;
box-shadow: inset 0 -3px 0 0 var(--tabs-blue) !important; /* This sets the blue bottom border for the active tab */
background-color: var(
--tabs-white
); /* This sets the background color for the active tab */
border-radius: 0 !important; /* This removes the border-radius */
color: var(--tabs-blue) !important;
position: relative;
}
/* Style for non-active tabs */
.nav-tabs .nav-link {
border: 1px solid var(--tabs-border) !important;
color: var(--tabs-grey); /* This sets the text color for the inactive tabs */
border-radius: 0 !important; /* This ensures no border radius for a flat design */
padding: 0.5rem 1rem;
margin-right: -1px;
text-wrap: nowrap !important;
flex-wrap: nowrap !important;
}
.nav-tabs .nav-item .nav-link:not(.active) {
.badge {
background-color: #6A7888 !important;
}
span:not(.badge, .close-tab) {
color: #556271 !important;
}
}
/* Style for the hover effect */
.nav-tabs .nav-link:hover {
border: none;
background-color: var(
--tabs-white
); /* This changes the background color when hovering */
}
/* Adding the 'x' button to the tab */
.nav-tabs .nav-link .close-tab {
font-size: 0.8rem;
color: var(--tabs-light);
margin-left: 0.5rem;
display: inline !important;
}
/* Style adjustments for the 'x' button */
.nav-tabs .nav-link .close-tab:hover {
color: var(--tabs-grey);
cursor: pointer;
}
.nav-tabs .nav-scroll {
position: absolute;
top: calc(50% - 0.75rem);
width: 1.5rem;
height: 1.5rem;
font-size: 0.75rem;
display: flex;
align-items: center;
justify-content: center;
background-color: var(--tabs-scroll-bg);
color: var(--tabs-grey);
cursor: pointer;
border: 1px solid var(--tabs-border);
border-radius: 100%;
z-index: 1;
}
.nav-tabs .nav-scroll-right {
right: 5px;
}
.nav-tabs .nav-scroll-left {
margin-left: 5px;
}
.nav-tabs .tabs-sticky {
position: sticky;
-webkit-position: sticky;
left: 0;
right: 0;
z-index: 2;
}
.nav-tabs .tabs-start {
background-color: var(--tabs-white);
}
/* add margin right to the last li element to hide safely the right scroll button */
.nav-tabs .nav-item:last-of-type {
margin-right: 2rem;
}
.flat-tabs .h-tab {
height: calc(100% - 42px) !important;
}
.dd-ml {
margin-left: 2rem;
}
</style>
1 change: 1 addition & 0 deletions src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import FormListTable from "./renderer/form-list-table.vue";
import FormAnalyticsChart from "./renderer/form-analytics-chart.vue";
import accordions from "@/components/accordions";
import VariableNameGenerator from "@/components/VariableNameGenerator";
import "../assets/css/tabs.css";

const rendererComponents = {
...renderer,
Expand Down

0 comments on commit 5320504

Please sign in to comment.