diff --git a/package.json b/package.json index c7c97bf..451b184 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jmespath-playground", - "version": "1.0.2", + "version": "1.0.3", "description": "A React-based web application for testing JMESPath expressions against JSON data", "main": "index.js", "scripts": { diff --git a/src/App.css b/src/App.css index 70da9a3..1fc7691 100644 --- a/src/App.css +++ b/src/App.css @@ -183,9 +183,9 @@ footer a:hover { } .theme-light .jmespath-input { - background-color: #ffffff !important; - border: 1px solid #ced4da !important; - color: #495057 !important; + background-color: #ffffff; + border: 1px solid #ced4da; + color: #495057; } .theme-light .json-input, @@ -195,15 +195,26 @@ footer a:hover { color: #495057 !important; } +/* Success and Error state overrides - must come after base input rules */ +.theme-light .jmespath-input.success { + background-color: #d4edda !important; + border-color: #c3e6cb !important; + color: #155724 !important; +} + +.theme-light .jmespath-input.error { + background-color: #f8d7da !important; + border-color: #f5c6cb !important; + color: #721c24 !important; +} + .theme-light .text-muted { color: #6c757d !important; } .theme-light .jmespath-input:focus { - background-color: var(--bg-primary-light) !important; - border-color: var(--accent-color) !important; - color: var(--text-secondary-light) !important; - box-shadow: 0 0 0 0.2rem var(--accent-shadow) !important; + border-color: var(--accent-color); + box-shadow: 0 0 0 0.2rem var(--accent-shadow); } .theme-light .jmespath-input::placeholder { @@ -233,6 +244,12 @@ footer a:hover { color: #721c24 !important; } +.theme-light .alert-success { + background-color: #d4edda !important; + border-color: #c3e6cb !important; + color: #155724 !important; +} + .theme-light .btn-primary { background-color: var(--btn-primary) !important; border-color: var(--btn-primary) !important; @@ -332,9 +349,22 @@ footer a:hover { } .theme-dark .jmespath-input { - background-color: var(--bg-card-dark) !important; - border: 1px solid #505050 !important; - color: var(--text-primary-dark) !important; + background-color: var(--bg-card-dark); + border: 1px solid #505050; + color: var(--text-primary-dark); +} + +/* Success and Error state overrides - must come after base input rules */ +.theme-dark .jmespath-input.success { + background-color: #1e4a1e !important; + border-color: #2c6d2c !important; + color: #d4edda !important; +} + +.theme-dark .jmespath-input.error { + background-color: #4a1e1e !important; + border-color: #6d2c2c !important; + color: #f8d7da !important; } .theme-dark .jmespath-input::placeholder { @@ -342,9 +372,7 @@ footer a:hover { } .theme-dark .jmespath-input:focus { - background-color: #404040 !important; - border-color: var(--accent-color) !important; - color: var(--text-primary-dark) !important; + border-color: var(--accent-color); } .theme-dark .json-input, @@ -376,6 +404,12 @@ footer a:hover { color: #f8d7da !important; } +.theme-dark .alert-success { + background-color: #1e4a1e !important; + border-color: #2c6d2c !important; + color: #d4edda !important; +} + .theme-dark .text-muted { color: var(--text-muted-dark) !important; } diff --git a/src/App.js b/src/App.js index 36c80ae..99b063f 100644 --- a/src/App.js +++ b/src/App.js @@ -33,12 +33,16 @@ function App() { // Apply theme to document const applyTheme = (selectedTheme) => { const root = document.documentElement; - root.className = ''; // Clear existing theme classes + const body = document.body; + + // Clear existing theme classes from both html and body + root.className = ''; + body.classList.remove('theme-light', 'theme-dark'); if (selectedTheme === 'light') { - root.classList.add('theme-light'); + body.classList.add('theme-light'); } else if (selectedTheme === 'dark') { - root.classList.add('theme-dark'); + body.classList.add('theme-dark'); } // 'auto' uses CSS media queries (no class needed) }; @@ -310,16 +314,14 @@ function App() {