Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,12 @@
}
},

// Front ends tests are modules
// Front ends tests are modules and run in jsdom (browser globals available)
{
"files": ["test/unit/frontend/**", "test/e2e/frontend/**"],
"env": {
"browser": true
},
"parserOptions": {
"sourceType": "module"
}
Expand Down
119 changes: 109 additions & 10 deletions config/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,117 @@ module.exports = {
theme: {
extend: {
colors: {
gray: {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just dropping comment so I don't forget - we need to sync up the Node-RED instances settings for 5.0 and others for themes to sync.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved this work into its own ticket since we will need Node-RED changes: Sync FlowFuse dark theme preference with Node-RED 5+ #7380

50: 'var(--ff-color-bg-surface)',
100: 'var(--ff-color-bg-surface-raised)',
200: 'var(--ff-color-border)',
300: 'var(--ff-color-border-strong)',
400: 'var(--ff-color-text-subtle)',
500: 'var(--ff-color-text-subtle)',
600: 'var(--ff-color-text-muted)',
700: 'var(--ff-color-text-muted)',
800: 'var(--ff-color-text)',
900: 'var(--ff-color-text)'
},

red: {
50: 'var(--ff-color-status-error-bg)',
100: 'var(--ff-color-status-error-bg)',
200: 'var(--ff-color-status-error-bg)',
300: 'var(--ff-color-status-error-border)',
400: 'var(--ff-color-danger-text)',
500: 'var(--ff-color-danger)',
600: 'var(--ff-color-danger-strong)',
700: 'var(--ff-color-danger-darker)',
800: 'var(--ff-color-danger-darker)',
900: 'var(--ff-color-danger-darker)'
},

green: {
50: 'var(--ff-color-status-progress-bg)',
100: 'var(--ff-color-status-progress-bg)',
200: 'var(--ff-color-status-success-bg)',
300: 'var(--ff-color-status-progress-border)',
400: 'var(--ff-color-status-success-border)',
500: 'var(--ff-color-status-success-text)',
600: 'var(--ff-color-status-success-text)',
700: 'var(--ff-color-status-success-text)',
800: 'var(--ff-color-status-success-text)',
900: 'var(--ff-color-status-success-text)'
},

yellow: {
50: 'var(--ff-color-status-safe-bg)',
100: 'var(--ff-color-status-safe-bg)',
200: 'var(--ff-color-status-safe-bg)',
300: 'var(--ff-color-status-safe-border)',
400: 'var(--ff-color-status-warning-bg)',
500: 'var(--ff-color-status-safe-text)',
600: 'var(--ff-color-status-safe-text)',
700: 'var(--ff-color-status-warning-text)',
800: 'var(--ff-color-status-warning-text)',
900: 'var(--ff-color-status-warning-text)'
},

blue: {
50: 'var(--ff-color-status-info-surface)',
100: 'var(--ff-color-status-info-surface)',
200: 'var(--ff-color-status-info-surface)',
300: 'var(--ff-color-status-info-surface-border)',
400: 'var(--ff-color-link)',
500: 'var(--ff-color-link)',
600: 'var(--ff-color-link)',
700: 'var(--ff-color-link-hover)',
800: 'var(--ff-color-link-hover)',
900: 'var(--ff-color-link-hover)'
},

indigo: {
50: 'var(--ff-color-accent-surface)',
100: 'var(--ff-color-accent-surface)',
200: 'var(--ff-color-accent-light)',
300: 'var(--ff-color-accent-light)',
400: 'var(--ff-color-focus)',
500: 'var(--ff-color-focus)',
600: 'var(--ff-color-accent)',
700: 'var(--ff-color-accent-hover)',
800: 'var(--ff-color-accent-strong)',
900: 'var(--ff-color-accent-strong)'
},

purple: {
50: 'var(--ff-color-status-devmode-bg)',
100: 'var(--ff-color-status-devmode-bg)',
200: 'var(--ff-color-status-devmode-bg)',
300: 'var(--ff-color-status-devmode-border)',
400: 'var(--ff-color-status-devmode-border)',
500: 'var(--ff-color-status-devmode-text)',
600: 'var(--ff-color-status-devmode-text)',
700: 'var(--ff-color-status-devmode-text)',
800: 'var(--ff-color-status-devmode-text)',
900: 'var(--ff-color-status-devmode-text)'
},

teal: {
50: '#E4FBFC',
100: '#C4F3F5',
200: '#B2EBEE',
300: '#8CE2E7',
400: '#74D4D9',
500: '#50C3C9',
600: '#35AAB0',
700: '#31959A',
800: '#397B7E',
900: '#406466'
50: 'var(--ff-color-status-fleetmode-bg)',
100: 'var(--ff-color-status-fleetmode-bg)',
200: 'var(--ff-color-status-fleetmode-bg)',
300: 'var(--ff-color-status-fleetmode-border)',
400: 'var(--ff-color-status-fleetmode-border)',
500: 'var(--ff-color-status-fleetmode-border)',
600: 'var(--ff-color-status-fleetmode-border)',
700: 'var(--ff-color-status-fleetmode-text)',
800: 'var(--ff-color-status-fleetmode-text)',
900: 'var(--ff-color-status-fleetmode-text)'
}
},
// `white` / `black` split per-context — bg and text want different tokens.
backgroundColor: {
white: 'var(--ff-color-bg-app)'
},
textColor: {
white: 'var(--ff-color-text-on-brand)',
black: 'var(--ff-color-text)'
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/SetupApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { markRaw } from 'vue'

import httpClient from './api/client.js'
import Logo from './components/Logo.vue'
import PageFooter from './components/PageFooter.vue'
import FFLayoutBox from './layouts/Box.vue'
import CreateAdminUser from './pages/setup/CreateAdminUser.vue'
import DefaultStack from './pages/setup/DefaultStack.vue'
Expand All @@ -35,7 +34,6 @@ const views = [
export default {
name: 'SetupApp',
components: {
PageFooter,
Logo,
CreateAdminUser,
License,
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/CodeSnippet.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<pre class="overflow-auto text-xs font-light p-4 border rounded-sm bg-gray-800 text-gray-200"><slot /></pre>
<pre class="overflow-auto text-xs font-light p-4 border rounded-sm ff-code-surface"><slot /></pre>
</template>

<script>
Expand Down
48 changes: 24 additions & 24 deletions frontend/src/components/ExpertButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export default {

/* Dual-background gradient border technique from flowfuse.com */
.expert-button {
background: linear-gradient(white, white) padding-box,
linear-gradient(135deg, $ff-red-600, #5048e5, $ff-red-600) border-box;
background: linear-gradient(var(--ff-color-bg-app), var(--ff-color-bg-app)) padding-box,
linear-gradient(135deg, var(--ff-palette-red-600), var(--ff-palette-indigo-600), var(--ff-palette-red-600)) border-box;
border: 1px solid transparent;
animation: gradient-border-rotate 4s linear infinite;

Expand All @@ -57,48 +57,48 @@ export default {

@keyframes gradient-border-rotate {
0% {
background: linear-gradient(white, white) padding-box,
linear-gradient(0deg, $ff-red-600, #5048e5, $ff-red-600) border-box;
background: linear-gradient(var(--ff-color-bg-app), var(--ff-color-bg-app)) padding-box,
linear-gradient(0deg, var(--ff-palette-red-600), var(--ff-palette-indigo-600), var(--ff-palette-red-600)) border-box;
}
10% {
background: linear-gradient(white, white) padding-box,
linear-gradient(36deg, $ff-red-600, #5048e5, $ff-red-600) border-box;
background: linear-gradient(var(--ff-color-bg-app), var(--ff-color-bg-app)) padding-box,
linear-gradient(36deg, var(--ff-palette-red-600), var(--ff-palette-indigo-600), var(--ff-palette-red-600)) border-box;
}
20% {
background: linear-gradient(white, white) padding-box,
linear-gradient(72deg, $ff-red-600, #5048e5, $ff-red-600) border-box;
background: linear-gradient(var(--ff-color-bg-app), var(--ff-color-bg-app)) padding-box,
linear-gradient(72deg, var(--ff-palette-red-600), var(--ff-palette-indigo-600), var(--ff-palette-red-600)) border-box;
}
30% {
background: linear-gradient(white, white) padding-box,
linear-gradient(108deg, $ff-red-600, #5048e5, $ff-red-600) border-box;
background: linear-gradient(var(--ff-color-bg-app), var(--ff-color-bg-app)) padding-box,
linear-gradient(108deg, var(--ff-palette-red-600), var(--ff-palette-indigo-600), var(--ff-palette-red-600)) border-box;
}
40% {
background: linear-gradient(white, white) padding-box,
linear-gradient(144deg, $ff-red-600, #5048e5, $ff-red-600) border-box;
background: linear-gradient(var(--ff-color-bg-app), var(--ff-color-bg-app)) padding-box,
linear-gradient(144deg, var(--ff-palette-red-600), var(--ff-palette-indigo-600), var(--ff-palette-red-600)) border-box;
}
50% {
background: linear-gradient(white, white) padding-box,
linear-gradient(180deg, $ff-red-600, #5048e5, $ff-red-600) border-box;
background: linear-gradient(var(--ff-color-bg-app), var(--ff-color-bg-app)) padding-box,
linear-gradient(180deg, var(--ff-palette-red-600), var(--ff-palette-indigo-600), var(--ff-palette-red-600)) border-box;
}
60% {
background: linear-gradient(white, white) padding-box,
linear-gradient(216deg, $ff-red-600, #5048e5, $ff-red-600) border-box;
background: linear-gradient(var(--ff-color-bg-app), var(--ff-color-bg-app)) padding-box,
linear-gradient(216deg, var(--ff-palette-red-600), var(--ff-palette-indigo-600), var(--ff-palette-red-600)) border-box;
}
70% {
background: linear-gradient(white, white) padding-box,
linear-gradient(252deg, $ff-red-600, #5048e5, $ff-red-600) border-box;
background: linear-gradient(var(--ff-color-bg-app), var(--ff-color-bg-app)) padding-box,
linear-gradient(252deg, var(--ff-palette-red-600), var(--ff-palette-indigo-600), var(--ff-palette-red-600)) border-box;
}
80% {
background: linear-gradient(white, white) padding-box,
linear-gradient(288deg, $ff-red-600, #5048e5, $ff-red-600) border-box;
background: linear-gradient(var(--ff-color-bg-app), var(--ff-color-bg-app)) padding-box,
linear-gradient(288deg, var(--ff-palette-red-600), var(--ff-palette-indigo-600), var(--ff-palette-red-600)) border-box;
}
90% {
background: linear-gradient(white, white) padding-box,
linear-gradient(324deg, $ff-red-600, #5048e5, $ff-red-600) border-box;
background: linear-gradient(var(--ff-color-bg-app), var(--ff-color-bg-app)) padding-box,
linear-gradient(324deg, var(--ff-palette-red-600), var(--ff-palette-indigo-600), var(--ff-palette-red-600)) border-box;
}
100% {
background: linear-gradient(white, white) padding-box,
linear-gradient(360deg, $ff-red-600, #5048e5, $ff-red-600) border-box;
background: linear-gradient(var(--ff-color-bg-app), var(--ff-color-bg-app)) padding-box,
linear-gradient(360deg, var(--ff-palette-red-600), var(--ff-palette-indigo-600), var(--ff-palette-red-600)) border-box;
}
}
</style>
6 changes: 3 additions & 3 deletions frontend/src/components/FileUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default {
.ff-file-upload--empty,
.ff-file-upload--file {
flex-grow: 1;
border: 1px solid $ff-grey-300;
border: 1px solid var(--ff-color-border-strong);
padding: $ff-unit-sm $ff-unit-md;
border-radius: $ff-unit-sm;
display: flex;
Expand All @@ -121,12 +121,12 @@ export default {
overflow-x: hidden;
}
.ff-file-upload--empty {
color: $ff-grey-400;
color: var(--ff-color-text-subtle);
}
.ff-file-upload--clear {
cursor: pointer;
&:hover {
color: $ff-blue-600;
color: var(--ff-color-link);
}
}
</style>
10 changes: 5 additions & 5 deletions frontend/src/components/IconLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ align-items: center;
position: relative;

border-radius: $ff-unit-sm;
border: 1px solid $ff-grey-300;
border: 1px solid var(--ff-color-border-strong);

height: 28px;
padding: $ff-unit-sm 5px;
Expand All @@ -58,13 +58,13 @@ svg {

&:hover {
cursor: pointer;
border-color: $ff-blue-600;
border-color: var(--ff-color-link);

color: $ff-blue-600;;
background-color: $ff-grey-50;
color: var(--ff-color-link);;
background-color: var(--ff-color-bg-surface);

.ff-icon {
color: $ff-blue-600;
color: var(--ff-color-link);
}
}
}
Expand Down
17 changes: 13 additions & 4 deletions frontend/src/components/Loading.vue
Original file line number Diff line number Diff line change
@@ -1,29 +1,38 @@
<template>
<div
class="ff-loading grow flex flex-col items-center justify-center mx-auto"
:class="{'theme-light': color == 'black', 'theme-dark': color == 'white'}"
:class="{'theme-light': resolvedColor == 'black', 'theme-dark': resolvedColor == 'white'}"
data-el="loading"
>
<div class="text-center w-64">
<lottie-animation v-if="color == 'white'" :animationData="require('../images/lottie/ff-loading-white.json')" :loop="true" />
<lottie-animation v-else-if="color == 'black'" :animationData="require('../images/lottie/ff-loading-black.json')" :loop="true" />
<lottie-animation v-if="resolvedColor == 'white'" :animationData="require('../images/lottie/ff-loading-white.json')" :loop="true" />
<lottie-animation v-else :animationData="require('../images/lottie/ff-loading-black.json')" :loop="true" />
<h4>{{ message || 'Loading...' }}</h4>
</div>
</div>
</template>
<script>
import { mapState } from 'pinia'

import { useThemeStore } from '@/stores/theme.ts'

export default {
name: 'ff-loading',
props: {
color: {
default: 'black', // 'white', 'black'
default: null,
type: String
},
message: {
default: null,
type: String
}
},
computed: {
...mapState(useThemeStore, ['effective']),
resolvedColor () {
return this.color || (this.effective === 'dark' ? 'white' : 'black')
}
}
}
</script>
6 changes: 3 additions & 3 deletions frontend/src/components/NotificationsButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default {
.notifications-button-wrapper {

.notifications-button {
color: $ff-grey-800;
color: var(--ff-color-text);
display: flex;
align-items: center;
flex: 1;
Expand All @@ -69,7 +69,7 @@ export default {
&:hover {
svg {
will-change: transform ;
color: $ff-indigo-600;
color: var(--ff-color-accent);
transform: scale(1.25) translateZ(0); /* Using slight adjustments to whole values */
backface-visibility: hidden;
perspective: 1000px;
Expand All @@ -85,7 +85,7 @@ export default {
position: absolute;
font-size: 0.65rem;
padding: 0 7px;
background-color: $ff-red-500;
background-color: var(--ff-color-danger);
}
}
}
Expand Down
15 changes: 0 additions & 15 deletions frontend/src/components/PageFooter.vue

This file was deleted.

Loading
Loading