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
15 changes: 15 additions & 0 deletions midnight/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# OS junk
Thumbs.db
Desktop.ini
.DS_Store

# Editors
.vscode/
.idea/

# Node tooling (npx/npm) if installed locally
node_modules/
npm-debug.log*

# Never commit local phpMyAdmin configuration
config.inc.php
338 changes: 338 additions & 0 deletions midnight/LICENSE

Large diffs are not rendered by default.

117 changes: 117 additions & 0 deletions midnight/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Midnight — a modern dark theme for phpMyAdmin

![Midnight theme screenshot](screen.png)

**Midnight** is a modern, elegant dark theme for [phpMyAdmin](https://www.phpmyadmin.net/) 5.2.
It is a complete visual redesign of the default `pmahomme` theme, built from a carefully
sampled dark palette (matched to a reference screenshot) instead of a generic invert —
one coherent token layer drives every component.

## Features

- **One source of truth for color** — all surfaces, text, borders and accents are defined
as tokens in `scss/_variables.scss` and flow into every component.
- **Fully dark form controls** — inputs, textareas, selects, checkboxes and radio buttons;
no white browser defaults left anywhere.
- **Every surface covered** — content area, sidebar/database tree, toolbars, tables
(with striping and hover rows), SQL editor and results, tabs, dropdowns, pagination,
modals, alerts, tooltips, icons.
- **Dark third-party widgets** — CodeMirror SQL editor with syntax highlighting,
jQuery UI, and the GIS/map controls are re-skinned too.
- **Thoughtful interaction states** — hover, focus, active, selected and disabled states
are redesigned for dark surfaces with visible focus rings.
- **RTL stylesheet included** — `css/theme.rtl.css` (generated with [rtlcss]).
- **Native dark mode** — `color-scheme: dark` matches scrollbars and widgets to the theme,
while `@media print` keeps paper output on a white background.
- **Visual only** — no PHP, no JavaScript, zero functional changes.

## Color palette

| Role | Hex |
| --------------------------------- | --------- |
| Page background | `#343b4d` |
| Chrome (sidebar, top bars, inputs)| `#1f2536` |
| Deep surfaces (tabs, dropdowns) | `#181f30` |
| Sunken (code blocks, wells) | `#1d2334` |
| Panels (cards, dialogs, popups) | `#2a3040` |
| Hover / active surfaces | `#3b4356` / `#47516a` |
| Borders / soft dividers | `#464e64` / `#394053` |
| Primary text (9.3:1 on page) | `#e8eaed` |
| Muted text (4.9:1 on page) | `#a3abbd` |
| Accent — links, focus, active tab | `#8ab4f8` |
| Filled primary button | `#2f5cc4` |
| Success / warning / danger / info | `#2ea043` / `#d9a406` / `#e5534b` / `#4f8ce8` |

Each status color ships with a matching dark background and light text variant
(`scss/_variables.scss`), so alerts and badges stay readable.

## Compatibility

- phpMyAdmin **5.2** (tested on 5.2.3)
- Modern evergreen browsers (Chrome, Edge, Firefox, Safari)

## Installation

### A. From a release zip (recommended)

1. Download `midnight-x.y.z.zip`.
2. Unzip it into the `themes/` directory of your phpMyAdmin installation, so you get
`themes/midnight/`.
3. Pick **midnight** from the theme selector at the bottom of the phpMyAdmin home page,
or set it as default in `config.inc.php`:

```php
$cfg['ThemeDefault'] = 'midnight';
```

### B. From git

```sh
cd /path/to/phpmyadmin/themes
git clone https://github.com/sa2ncom/midnight.git
```

> Note: GitHub's "Download ZIP" unpacks as `midnight-main/` — rename the folder to
> `midnight` after extracting, otherwise the theme will not be listed.

## Building from source

The SCSS imports phpMyAdmin's shared Bootstrap sources (`../../bootstrap/scss`), so the
build must run inside a phpMyAdmin checkout where this folder sits in `themes/midnight`.
You need Node.js with `sass`, `postcss-cli` and `autoprefixer` installed.

```sh
cd /path/to/phpmyadmin

# 1. compile SCSS → CSS (compressed, with source map)
npx sass themes/midnight/scss:themes/midnight/css --style=compressed

# 2. add vendor prefixes
npx postcss themes/midnight/css/theme.css --use autoprefixer --replace

# 3. generate the RTL variant
npx rtlcss themes/midnight/css/theme.css themes/midnight/css/theme.rtl.css
```

Never edit `css/theme.css` by hand — it is generated. Change the files in `scss/`
and rebuild.

## Verification

- Runtime audits across **25+ screens** (server home, database/table structure, browse,
SQL editor, export/import, operations, search, privileges, settings, login, modals,
console): **zero light surfaces and zero contrast failures below 3:1**.
- Static scan of the built CSS: every remaining light value lives inside
`@media print` only (white paper output is intentional).
- `css/theme.css` and `css/theme.rtl.css` are verified to contain identical rule counts.

## Credits and license

- Based on **pmahomme**, the default phpMyAdmin theme, by the phpMyAdmin developers.
- Built on the libraries shipped with phpMyAdmin (Bootstrap, CodeMirror, jQuery UI).
- Licensed under the [GNU General Public License v2.0-or-later](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html),
the same license as phpMyAdmin itself.

Issues and suggestions: <https://github.com/sa2ncom/midnight/issues>

[rtlcss]: https://rtlcss.com/
67 changes: 67 additions & 0 deletions midnight/build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
param(
[switch]$SkipRtl
)

$ErrorActionPreference = 'Stop'

# This script lives inside <phpmyadmin>/themes/<folder>.
# Paths are derived from its own location, so renames/moves keep working.
$here = $PSScriptRoot
$root = Split-Path (Split-Path $here -Parent) -Parent # phpMyAdmin root
$folder = Split-Path $here -Leaf # theme folder name
$theme = "themes/$folder"
$css = Join-Path $here 'css'

# The SCSS imports phpMyAdmin's shared Bootstrap sources (../../bootstrap/scss).
if (-not (Test-Path (Join-Path $root 'themes\bootstrap\scss'))) {
throw "Shared Bootstrap SCSS not found at $root\themes\bootstrap\scss. Run this script from inside a phpMyAdmin checkout: <phpmyadmin>/themes/$folder/build.ps1"
}

Push-Location $root
try {
Write-Output '== 1/4 sass (compressed) =='
npx sass "${theme}/scss:${theme}/css" --style=compressed
if ($LASTEXITCODE -ne 0) { throw "sass failed: $LASTEXITCODE" }

Write-Output '== 2/4 autoprefixer =='
npx postcss "$theme/css/theme.css" --use autoprefixer --replace
if ($LASTEXITCODE -ne 0) { throw "postcss failed: $LASTEXITCODE" }

Write-Output '== 3/4 strip sourcesContent from inline map =='
$strip = @'
const fs = require('fs');
const p = process.argv[2];
let t = fs.readFileSync(p, 'utf8');
const k = t.lastIndexOf('base64,');
if (k < 0) { console.error('no inline map'); process.exit(2); }
const start = k + 7;
const end = t.indexOf(' */', start);
if (end < 0) { console.error('unterminated inline map'); process.exit(3); }
const obj = JSON.parse(Buffer.from(t.slice(start, end), 'base64').toString('utf8'));
delete obj.sourcesContent;
const nb = Buffer.from(JSON.stringify(obj), 'utf8').toString('base64');
fs.writeFileSync(p, t.slice(0, start) + nb + t.slice(end));
console.log('map json -> ' + JSON.stringify(obj).length + ' bytes (sourcesContent removed)');
'@
$stripPath = Join-Path $env:TEMP 'pma-strip-map.js'
Set-Content -Path $stripPath -Value $strip -Encoding ASCII
node $stripPath "$css\theme.css"
if ($LASTEXITCODE -ne 0) { throw "map strip failed: $LASTEXITCODE" }

if (-not $SkipRtl) {
Write-Output '== 4/4 rtlcss =='
$rtlCfg = Join-Path $root '.rtlcssrc.json'
if (Test-Path $rtlCfg) {
npx rtlcss -c $rtlCfg "$theme/css/theme.css" "$theme/css/theme.rtl.css"
} else {
npx rtlcss "$theme/css/theme.css" "$theme/css/theme.rtl.css"
}
if ($LASTEXITCODE -ne 0) { throw "rtlcss failed: $LASTEXITCODE" }
}
}
finally {
Pop-Location
}

Write-Output '== output =='
Get-ChildItem $css -Filter 'theme*.css*' | Select-Object Name, Length, LastWriteTime | Format-Table -AutoSize
3 changes: 3 additions & 0 deletions midnight/css/theme.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions midnight/css/theme.css.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions midnight/css/theme.rtl.css

Large diffs are not rendered by default.

Binary file added midnight/img/ajax_clock_small.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added midnight/img/arrow_ltr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added midnight/img/arrow_rtl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added midnight/img/asc_order.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added midnight/img/b_bookmark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added midnight/img/b_browse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added midnight/img/b_calendar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added midnight/img/b_chart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added midnight/img/b_close.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added midnight/img/b_column_add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added midnight/img/b_comment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added midnight/img/b_dbstatistics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added midnight/img/b_deltbl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added midnight/img/b_docs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added midnight/img/b_docsql.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added midnight/img/b_drop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added midnight/img/b_edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added midnight/img/b_empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added midnight/img/b_engine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added midnight/img/b_event_add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added midnight/img/b_events.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added midnight/img/b_export.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added midnight/img/b_favorite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added midnight/img/b_find_replace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added midnight/img/b_firstpage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added midnight/img/b_ftext.png
Binary file added midnight/img/b_globe.gif
Binary file added midnight/img/b_group.png
Binary file added midnight/img/b_help.png
Binary file added midnight/img/b_home.png
Binary file added midnight/img/b_import.png
Binary file added midnight/img/b_index.png
Binary file added midnight/img/b_index_add.png
Binary file added midnight/img/b_inline_edit.png
Binary file added midnight/img/b_insrow.png
Binary file added midnight/img/b_key.png
Binary file added midnight/img/b_lastpage.png
Binary file added midnight/img/b_left.png
Binary file added midnight/img/b_minus.png
Binary file added midnight/img/b_more.png
Binary file added midnight/img/b_move.png
Binary file added midnight/img/b_newdb.png
Binary file added midnight/img/b_newtbl.png
Binary file added midnight/img/b_nextpage.png
Binary file added midnight/img/b_no_favorite.png
Binary file added midnight/img/b_pdfdoc.png
Binary file added midnight/img/b_plugin.png
Binary file added midnight/img/b_plus.png
Binary file added midnight/img/b_prevpage.png
Binary file added midnight/img/b_primary.png
Binary file added midnight/img/b_print.png
Binary file added midnight/img/b_props.png
Binary file added midnight/img/b_relations.png
1 change: 1 addition & 0 deletions midnight/img/b_rename.svg
Binary file added midnight/img/b_report.png
Binary file added midnight/img/b_right.png
Binary file added midnight/img/b_routine_add.png
Binary file added midnight/img/b_routines.png
Binary file added midnight/img/b_save.png
Binary file added midnight/img/b_saveimage.png
Binary file added midnight/img/b_sbrowse.png
Binary file added midnight/img/b_sdb.png
Binary file added midnight/img/b_search.png
Binary file added midnight/img/b_select.png
Binary file added midnight/img/b_snewtbl.png
Binary file added midnight/img/b_spatial.png
Binary file added midnight/img/b_sql.png
Binary file added midnight/img/b_sqldoc.png
Binary file added midnight/img/b_sqlhelp.png
Binary file added midnight/img/b_table_add.png
Binary file added midnight/img/b_tblanalyse.png
Binary file added midnight/img/b_tblexport.png
Binary file added midnight/img/b_tblimport.png
Binary file added midnight/img/b_tblops.png
Binary file added midnight/img/b_tbloptimize.png
Binary file added midnight/img/b_tipp.png
Binary file added midnight/img/b_trigger_add.png
Binary file added midnight/img/b_triggers.png
Binary file added midnight/img/b_undo.png
Binary file added midnight/img/b_unique.png
Binary file added midnight/img/b_usradd.png
Binary file added midnight/img/b_usrcheck.png
Binary file added midnight/img/b_usrdrop.png
Binary file added midnight/img/b_usredit.png
Binary file added midnight/img/b_usrlist.png
Binary file added midnight/img/b_versions.png
Binary file added midnight/img/b_view.png
Binary file added midnight/img/b_view_add.png
Binary file added midnight/img/b_views.png
Binary file added midnight/img/bd_browse.png
Binary file added midnight/img/bd_deltbl.png
Binary file added midnight/img/bd_drop.png
Binary file added midnight/img/bd_edit.png
Binary file added midnight/img/bd_empty.png
Binary file added midnight/img/bd_export.png
Binary file added midnight/img/bd_firstpage.png
Binary file added midnight/img/bd_ftext.png
Binary file added midnight/img/bd_index.png
Binary file added midnight/img/bd_insrow.png
Binary file added midnight/img/bd_lastpage.png
Binary file added midnight/img/bd_nextpage.png
Binary file added midnight/img/bd_prevpage.png
Binary file added midnight/img/bd_primary.png
Binary file added midnight/img/bd_routine_add.png
Binary file added midnight/img/bd_sbrowse.png
Binary file added midnight/img/bd_select.png
Binary file added midnight/img/bd_spatial.png
Binary file added midnight/img/bd_unique.png
Binary file added midnight/img/centralColumns.png
Binary file added midnight/img/centralColumns_add.png
Binary file added midnight/img/centralColumns_delete.png
Binary file added midnight/img/col_drop.png
Binary file added midnight/img/col_pointer.png
Binary file added midnight/img/col_pointer_ver.png
Binary file added midnight/img/console.png
Binary file added midnight/img/database.png
Binary file added midnight/img/designer/1.png
Binary file added midnight/img/designer/2.png
Binary file added midnight/img/designer/2leftarrow.png
Binary file added midnight/img/designer/2leftarrow_m.png
Binary file added midnight/img/designer/2rightarrow.png
Binary file added midnight/img/designer/2rightarrow_m.png
Binary file added midnight/img/designer/3.png
Binary file added midnight/img/designer/4.png
Binary file added midnight/img/designer/5.png
Binary file added midnight/img/designer/6.png
Binary file added midnight/img/designer/7.png
Binary file added midnight/img/designer/8.png
Binary file added midnight/img/designer/FieldKey_small.png
Binary file added midnight/img/designer/Field_small.png
Binary file added midnight/img/designer/Field_small_char.png
Binary file added midnight/img/designer/Field_small_date.png
Binary file added midnight/img/designer/Field_small_int.png
Binary file added midnight/img/designer/anchor.png
Binary file added midnight/img/designer/and_icon.png
Binary file added midnight/img/designer/ang_direct.png
Binary file added midnight/img/designer/bottom.png
Binary file added midnight/img/designer/def.png
Binary file added midnight/img/designer/display_field.png
Binary file added midnight/img/designer/downarrow1.png
Binary file added midnight/img/designer/downarrow2.png
Binary file added midnight/img/designer/downarrow2_m.png
Binary file added midnight/img/designer/exec.png
Binary file added midnight/img/designer/exec_small.png
Binary file added midnight/img/designer/exitFullscreen.png
Binary file added midnight/img/designer/export.png
Binary file added midnight/img/designer/favicon.ico
Binary file not shown.
Binary file added midnight/img/designer/grid.png
Binary file added midnight/img/designer/help.png
Binary file added midnight/img/designer/help_relation.png
Binary file added midnight/img/designer/left_panel_tab.png
Binary file added midnight/img/designer/minus.png
Binary file added midnight/img/designer/or_icon.png
Binary file added midnight/img/designer/other_table.png
Binary file added midnight/img/designer/page_add.png
Binary file added midnight/img/designer/page_delete.png
Binary file added midnight/img/designer/page_edit.png
Binary file added midnight/img/designer/pdf.png
Binary file added midnight/img/designer/plus.png
Binary file added midnight/img/designer/query_builder.png
Binary file added midnight/img/designer/relation.png
Binary file added midnight/img/designer/reload.png
Binary file added midnight/img/designer/resize.png
Binary file added midnight/img/designer/resizeright.png
Binary file added midnight/img/designer/rightarrow1.png
Binary file added midnight/img/designer/rightarrow2.png
Binary file added midnight/img/designer/save.png
Binary file added midnight/img/designer/save_as.png
Binary file added midnight/img/designer/small_tab.png
Binary file added midnight/img/designer/table.png
Binary file added midnight/img/designer/toggle_lines.png
Binary file added midnight/img/designer/top_panel.png
Binary file added midnight/img/designer/uparrow2_m.png
Binary file added midnight/img/designer/viewInFullscreen.png
Binary file added midnight/img/east-mini.png
Binary file added midnight/img/error.ico
Binary file not shown.
Binary file added midnight/img/eye.png
Binary file added midnight/img/eye_grey.png
Binary file added midnight/img/hide.png
Binary file added midnight/img/item.png
Binary file added midnight/img/lightbulb.png
Binary file added midnight/img/lightbulb_off.png
Binary file added midnight/img/lock_open.png
Binary file added midnight/img/logo_left.png
Binary file added midnight/img/logo_right.png
Binary file added midnight/img/more.png
Binary file added midnight/img/new_data.png
Binary file added midnight/img/new_data_hovered.png
Binary file added midnight/img/new_data_selected.png
Binary file added midnight/img/new_data_selected_hovered.png
Binary file added midnight/img/new_struct.png
Binary file added midnight/img/new_struct_hovered.png
Binary file added midnight/img/new_struct_selected.png
Binary file added midnight/img/new_struct_selected_hovered.png
Binary file added midnight/img/normalize.png
Binary file added midnight/img/north-mini.png
Binary file added midnight/img/pause.png
Binary file added midnight/img/php_sym.png
Binary file added midnight/img/play.png
Binary file added midnight/img/pma_logo2.png
Binary file added midnight/img/s_asc.png
Binary file added midnight/img/s_asci.png
Binary file added midnight/img/s_attention.png
Binary file added midnight/img/s_cancel.png
Binary file added midnight/img/s_cancel2.png
Binary file added midnight/img/s_cog.png
Binary file added midnight/img/s_collapseall.png
Binary file added midnight/img/s_db.png
Binary file added midnight/img/s_desc.png
Binary file added midnight/img/s_error.png
Binary file added midnight/img/s_fulltext.png
Binary file added midnight/img/s_host.png
Binary file added midnight/img/s_info.png
Binary file added midnight/img/s_lang.png
Binary file added midnight/img/s_link.png
Binary file added midnight/img/s_lock.png
Binary file added midnight/img/s_loggoff.png
Binary file added midnight/img/s_notice.png
Binary file added midnight/img/s_okay.png
Binary file added midnight/img/s_partialtext.png
Binary file added midnight/img/s_passwd.png
Binary file added midnight/img/s_process.png
Binary file added midnight/img/s_really.png
Binary file added midnight/img/s_reload.png
Binary file added midnight/img/s_replication.png
Binary file added midnight/img/s_rights.png
Binary file added midnight/img/s_sortable.png
Binary file added midnight/img/s_status.png
Binary file added midnight/img/s_success.png
Binary file added midnight/img/s_sync.png
Binary file added midnight/img/s_tbl.png
Binary file added midnight/img/s_theme.png
Binary file added midnight/img/s_top.png
Binary file added midnight/img/s_unlink.png
Binary file added midnight/img/s_vars.png
Binary file added midnight/img/s_views.png
Binary file added midnight/img/show.png
Binary file added midnight/img/south-mini.png
Binary file added midnight/img/spacer.png
Binary file added midnight/img/toggle-ltr.png
Binary file added midnight/img/toggle-rtl.png
Binary file added midnight/img/vertical_line.png
Binary file added midnight/img/west-mini.png
Binary file added midnight/img/window-new.png
Binary file added midnight/img/zoom-minus-mini.png
Binary file added midnight/img/zoom-plus-mini.png
Binary file added midnight/img/zoom-world-mini.png
Loading