Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

refactor(settings): replace static inline styles with SCSS classes

Juan Denis9f1aed794388
diff --git a/frontend/src/components/settings/AISettingsTab.jsx b/frontend/src/components/settings/AISettingsTab.jsx
index 337a56fd..ad8613cc 100644
--- a/frontend/src/components/settings/AISettingsTab.jsx
+++ b/frontend/src/components/settings/AISettingsTab.jsx
@@ -213,7 +213,7 @@ const AISettingsTab = () => {
</div>
</div>
- <div className="settings-actions" style={{ display: 'flex', gap: '8px', marginTop: '12px' }}>
+ <div className="settings-actions">
<Button variant="outline" onClick={handleTest} disabled={testing || !settings.provider || !settings.model}>
{testing ? 'Testing…' : 'Test connection'}
</Button>
diff --git a/frontend/src/components/settings/AppearanceTab.jsx b/frontend/src/components/settings/AppearanceTab.jsx
index 34006e0c..063c6517 100644
--- a/frontend/src/components/settings/AppearanceTab.jsx
+++ b/frontend/src/components/settings/AppearanceTab.jsx
@@ -125,7 +125,7 @@ const AppearanceTab = () => {
ref={fileInputRef}
type="file"
accept="application/json,.json"
- style={{ display: 'none' }}
+ className="hidden"
onChange={onImportFile}
/>
<Button variant="outline" size="sm" onClick={() => setBrowseOpen(true)}>
diff --git a/frontend/src/components/settings/IconReferenceTab.jsx b/frontend/src/components/settings/IconReferenceTab.jsx
index d78da58e..f3ad9067 100644
--- a/frontend/src/components/settings/IconReferenceTab.jsx
+++ b/frontend/src/components/settings/IconReferenceTab.jsx
@@ -89,14 +89,13 @@ const IconReferenceTab = () => {
<div className="settings-card">
<div className="form-group">
- <div className="search-input-wrapper" style={{ position: 'relative' }}>
- <Search size={16} style={{ position: 'absolute', left: 12, top: '50%', transform: 'translateY(-50%)', opacity: 0.5 }} />
+ <div className="search-input-wrapper">
+ <Search size={16} className="icon-search-ico" />
<Input
type="text"
placeholder={t('app.iconReferenceTab.searchIcons', 'Search icons...')}
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
- style={{ paddingLeft: 36 }}
/>
</div>
</div>
@@ -125,7 +124,7 @@ const IconReferenceTab = () => {
{Object.keys(filteredCatalog).length === 0 && (
<div className="settings-card">
- <p style={{ textAlign: 'center', opacity: 0.5 }}>{t('app.iconReferenceTab.noIconsMatch', 'No icons match "{{query}}"', { query: searchQuery })}</p>
+ <p className="icon-ref-empty">{t('app.iconReferenceTab.noIconsMatch', 'No icons match "{{query}}"', { query: searchQuery })}</p>
</div>
)}
</div>
diff --git a/frontend/src/components/settings/InviteModal.jsx b/frontend/src/components/settings/InviteModal.jsx
index 90fcd607..94ff981b 100644
--- a/frontend/src/components/settings/InviteModal.jsx
+++ b/frontend/src/components/settings/InviteModal.jsx
@@ -82,12 +82,12 @@ const InviteModal = ({ onClose, onCreated }) => {
</Button>
</div>
{result.email_sent && (
- <p className="text-success" style={{ marginTop: 12 }}>
+ <p className="text-success invite-result-note">
{t('app.inviteModal.invitationEmailSentTo', 'Invitation email sent to')} {result.invitation.email}
</p>
)}
{result.email_error && (
- <p className="text-warning" style={{ marginTop: 12 }}>
+ <p className="text-warning invite-result-note">
{t('app.inviteModal.emailCouldNotBeSent', 'Email could not be sent:')} {result.email_error}
</p>
)}
@@ -167,7 +167,7 @@ const InviteModal = ({ onClose, onCreated }) => {
}}
>
{showPermissions ? 'Hide' : 'Customize'} {t('app.inviteModal.permissions', 'Permissions')}
- <svg viewBox="0 0 24 24" width="14" height="14" stroke="currentColor" fill="none" strokeWidth="2" style={{ marginLeft: 4 }}>
+ <svg viewBox="0 0 24 24" width="14" height="14" stroke="currentColor" fill="none" strokeWidth="2" className="invite-caret">
{showPermissions
? <polyline points="18 15 12 9 6 15"/>
: <polyline points="6 9 12 15 18 9"/>
diff --git a/frontend/src/components/settings/MemberActionsCard.jsx b/frontend/src/components/settings/MemberActionsCard.jsx
index 156c6cd8..ad8910f0 100644
--- a/frontend/src/components/settings/MemberActionsCard.jsx
+++ b/frontend/src/components/settings/MemberActionsCard.jsx
@@ -47,12 +47,12 @@ const MemberActionsCard = () => {
return (
<div className="settings-card">
<h3>{t('app.memberActionsCard.memberActions', 'Member Actions')}</h3>
- <p className="form-help" style={{ marginTop: 0 }}>
+ <p className="form-help form-help--flush">
{t('app.memberActionsCard.letWorkspaceMembersRunASmall', 'Let workspace members run a small set of curated, parameterized actions (like adjusting an app\'s backup frequency) for apps they can reach. Every action is validated against a fixed schema and audit-logged — no free text ever reaches the server shell. Turn this off to disable the whole member-action surface.')}
</p>
<div className="form-group">
- <label style={{ display: 'flex', alignItems: 'center', gap: '0.5rem' }}>
+ <label className="member-check-label">
<input
type="checkbox"
checked={enabled}
@@ -67,7 +67,7 @@ const MemberActionsCard = () => {
{saving ? 'Saving…' : 'Save'}
</Button>
{message && (
- <span className={`timezone-message ${message.type}`} style={{ marginLeft: '0.75rem' }}>
+ <span className={`timezone-message timezone-message--inline ${message.type}`}>
{message.text}
</span>
)}
diff --git a/frontend/src/components/settings/SystemTab.jsx b/frontend/src/components/settings/SystemTab.jsx
index a7a66c1e..ff26857f 100644
--- a/frontend/src/components/settings/SystemTab.jsx
+++ b/frontend/src/components/settings/SystemTab.jsx
@@ -227,7 +227,7 @@ const SystemTab = () => {
<div {...register('system-timezone', 'settings-card')}>
<h3>{t('app.systemTab.serverTimeTimezone', 'Server Time & Timezone')}</h3>
{metrics?.time && (
- <InfoList style={{ marginBottom: '1rem' }}>
+ <InfoList className="info-list--spaced">
<InfoItem label={t('app.systemTab.currentTime', 'Current Time')} value={metrics.time.current_time_formatted} />
<InfoItem label={t('app.systemTab.utcOffset', 'UTC Offset')} value={metrics.time.utc_offset} />
<InfoItem label={t('app.systemTab.currentTimezone', 'Current Timezone')} value={metrics.time.timezone_id || metrics.time.timezone_name} />
@@ -273,7 +273,7 @@ const SystemTab = () => {
<div {...register('system-canonical-domain', 'settings-card')}>
<h3>{t('app.systemTab.panelDomain', 'Panel Domain')}</h3>
{!encryptionConfigured && (
- <div className="alert alert-warning" style={{ marginBottom: '1rem' }}>
+ <div className="alert alert-warning settings-alert-spaced">
<strong>{t('app.systemTab.encryptionKeyNotConfigured', 'Encryption key not configured.')}</strong> {t('app.systemTab.agentPairingAndSecretEncryptionWill', 'Agent pairing and secret encryption will fail until SERVERKIT_ENCRYPTION_KEY is set in your .env file.')}
</div>
)}
@@ -284,8 +284,8 @@ const SystemTab = () => {
{detectedDomain?.detected_domain && (
<div className="form-group">
<label>{t('app.systemTab.detectedDomain', 'Detected Domain')}</label>
- <div className="form-row" style={{ display: 'flex', gap: '0.75rem', alignItems: 'center' }}>
- <code style={{ flex: 1 }}>
+ <div className="form-row system-domain-row">
+ <code>
{detectedDomain.is_https ? 'https' : 'http'}://{detectedDomain.detected_domain}
</code>
<Button
@@ -323,14 +323,14 @@ const SystemTab = () => {
{t('app.systemTab.theDomainYouPointAtThis', 'The domain you point at this ServerKit panel. Used for CORS and agent install commands.')}
</span>
</div>
- <div className="form-group" style={{ display: 'flex', alignItems: 'center', gap: '0.75rem' }}>
+ <div className="form-group system-switch-row">
<Switch
id="canonical-https"
checked={canonicalHttps}
onCheckedChange={setCanonicalHttps}
disabled={savingDomain}
/>
- <label htmlFor="canonical-https" style={{ margin: 0 }}>
+ <label htmlFor="canonical-https">
{t('app.systemTab.httpsEnabledForCanonicalDomain', 'HTTPS enabled for canonical domain')}
</label>
</div>
@@ -342,7 +342,7 @@ const SystemTab = () => {
{savingDomain ? 'Saving...' : 'Save Canonical Domain'}
</Button>
{domainMessage && (
- <div className={`timezone-message ${domainMessage.type}`} style={{ marginTop: '0.75rem' }}>
+ <div className={`timezone-message timezone-message--save-result ${domainMessage.type}`}>
{domainMessage.text}
</div>
)}
diff --git a/frontend/src/components/settings/TwoFactorPolicyCard.jsx b/frontend/src/components/settings/TwoFactorPolicyCard.jsx
index 3d516a96..bc429b98 100644
--- a/frontend/src/components/settings/TwoFactorPolicyCard.jsx
+++ b/frontend/src/components/settings/TwoFactorPolicyCard.jsx
@@ -61,7 +61,7 @@ const TwoFactorPolicyCard = (props) => {
return (
<div className="settings-card" {...props}>
<h3>{t('app.twoFactorPolicyCard.twoFactorAuthenticationPolicy', 'Two-Factor Authentication Policy')}</h3>
- <p className="form-help" style={{ marginTop: 0 }}>
+ <p className="form-help form-help--flush">
{t('app.twoFactorPolicyCard.requireAccountsToProtectThemselvesWith', 'Require accounts to protect themselves with a passkey or authenticator app. Passwords keep working until the grace window ends; after that, sign-in only lets the user reach the enrolment screen until they add a second factor. Single sign-on users are always exempt.')}
</p>
@@ -84,10 +84,10 @@ const TwoFactorPolicyCard = (props) => {
<label>{t('app.twoFactorPolicyCard.gracePeriodDays', 'Grace period (days)')}</label>
<Input
type="number"
+ className="policy-grace-input"
min="0"
value={graceDays}
onChange={(e) => setGraceDays(e.target.value)}
- style={{ maxWidth: '120px' }}
/>
<span className="form-help">
{t('app.twoFactorPolicyCard.daysANewlyCoveredAccountMay', 'Days a newly-covered account may keep signing in with just a password before enrolment is enforced.')}
@@ -100,7 +100,7 @@ const TwoFactorPolicyCard = (props) => {
{saving ? 'Saving…' : 'Save policy'}
</Button>
{message && (
- <span className={`timezone-message ${message.type}`} style={{ marginLeft: '0.75rem' }}>
+ <span className={`timezone-message timezone-message--inline ${message.type}`}>
{message.text}
</span>
)}
diff --git a/frontend/src/components/settings/WhiteLabelTab.jsx b/frontend/src/components/settings/WhiteLabelTab.jsx
index 4666769b..0c13ec80 100644
--- a/frontend/src/components/settings/WhiteLabelTab.jsx
+++ b/frontend/src/components/settings/WhiteLabelTab.jsx
@@ -100,7 +100,7 @@ const WhiteLabelTab = () => {
ref={logoInputRef}
type="file"
accept="image/png,image/jpeg,image/svg+xml,image/webp"
- style={{ display: 'none' }}
+ className="hidden"
onChange={(e) => {
const file = e.target.files?.[0];
if (!file) return;
diff --git a/frontend/src/styles/pages/_settings.scss b/frontend/src/styles/pages/_settings.scss
index 7a99e4bd..7133ec05 100644
--- a/frontend/src/styles/pages/_settings.scss
+++ b/frontend/src/styles/pages/_settings.scss
@@ -816,6 +816,93 @@
}
}
+.info-list--spaced {
+ margin-bottom: $space-4;
+}
+
+// SystemTab: canonical-domain rows
+.system-domain-row {
+ display: flex;
+ align-items: center;
+ gap: $space-3;
+
+ code {
+ flex: 1;
+ }
+}
+
+.system-switch-row {
+ display: flex;
+ align-items: center;
+ gap: $space-3;
+
+ label {
+ margin: 0;
+ }
+}
+
+.settings-alert-spaced {
+ margin-bottom: $space-4;
+}
+
+.form-help--flush {
+ margin-top: 0;
+}
+
+.policy-grace-input {
+ max-width: 120px;
+}
+
+.member-check-label {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+}
+
+.settings-actions {
+ display: flex;
+ gap: $space-2;
+ margin-top: $space-3;
+}
+
+.invite-result-note {
+ margin-top: $space-3;
+}
+
+.invite-caret {
+ margin-left: $space-1;
+}
+
+// IconReferenceTab: leading magnifier inside the search field
+.search-input-wrapper {
+ position: relative;
+
+ .icon-search-ico {
+ position: absolute;
+ left: $space-3;
+ top: 50%;
+ transform: translateY(-50%);
+ opacity: 0.5;
+ }
+
+ input {
+ padding-left: 36px;
+ }
+}
+
+.icon-ref-empty {
+ text-align: center;
+ opacity: 0.5;
+}
+
+.timezone-message--save-result {
+ margin-top: $space-3;
+}
+
+.timezone-message--inline {
+ margin-left: $space-3;
+}
+
// Timezone Selector
.timezone-selector {
display: flex;