Index: libcss/src/parse/propstrings.h
===================================================================
--- libcss/src/parse/propstrings.h	(revision 10731)
+++ libcss/src/parse/propstrings.h	(working copy)
@@ -117,6 +117,38 @@
 
 	LAST_COLOUR = YELLOWGREEN,
 
+	/* System colours */
+	FIRST_SYSTEM_COLOUR,
+	SYSCOL_ACTIVEBORDER = FIRST_SYSTEM_COLOUR,
+	SYSCOL_ACTIVECAPTION,
+	SYSCOL_APPWORKSPACE,
+	SYSCOL_BACKGROUND,
+	SYSCOL_BUTTONFACE,
+	SYSCOL_BUTTONHIGHLIGHT,
+	SYSCOL_BUTTONSHADOW,
+	SYSCOL_BUTTONTEXT,
+	SYSCOL_CAPTIONTEXT,
+	SYSCOL_GRAYTEXT,
+	SYSCOL_HIGHLIGHT,
+	SYSCOL_HIGHLIGHTTEXT,
+	SYSCOL_INACTIVEBORDER,
+	SYSCOL_INACTIVECAPTION,
+	SYSCOL_INACTIVECAPTIONTEXT,
+	SYSCOL_INFOBACKGROUND,
+	SYSCOL_INFOTEXT,
+	SYSCOL_MENU,
+	SYSCOL_MENUTEXT,
+	SYSCOL_SCROLLBAR,
+	SYSCOL_THREEDDARKSHADOW,
+	SYSCOL_THREEDFACE,
+	SYSCOL_THREEDHIGHLIGHT,
+	SYSCOL_THREEDLIGHTSHADOW,
+	SYSCOL_THREEDSHADOW,
+	SYSCOL_WINDOW,
+	SYSCOL_WINDOWFRAME,
+	SYSCOL_WINDOWTEXT,
+	LAST_SYSTEM_COLOUR = SYSCOL_WINDOWTEXT,
+
 	LAST_KNOWN
 };
 
Index: libcss/src/parse/propstrings.c
===================================================================
--- libcss/src/parse/propstrings.c	(revision 10731)
+++ libcss/src/parse/propstrings.c	(working copy)
@@ -483,7 +483,36 @@
 	{ "white", SLEN("white") },
 	{ "whitesmoke", SLEN("whitesmoke") },
 	{ "yellow", SLEN("yellow") },
-	{ "yellowgreen", SLEN("yellowgreen") }
+	{ "yellowgreen", SLEN("yellowgreen") },
+
+	{ "activeborder", SLEN("activeborder") },
+	{ "activecaption", SLEN("activecaption") },
+	{ "appworkspace", SLEN("appworkspace") },
+	{ "background", SLEN("background") },
+	{ "buttonface", SLEN("buttonface") },
+	{ "buttonhighlight", SLEN("buttonhighlight") },
+	{ "buttonshadow", SLEN("buttonshadow") },
+	{ "buttontext", SLEN("buttontext") },
+	{ "captiontext", SLEN("captiontext") },
+	{ "graytext", SLEN("graytext") },
+	{ "highlight", SLEN("highlight") },
+	{ "highlighttext", SLEN("highlighttext") },
+	{ "inactiveborder", SLEN("inactiveborder") },
+	{ "inactivecaption", SLEN("inactivecaption") },
+	{ "inactivecaptiontext", SLEN("inactivecaptiontext") },
+	{ "infobackground", SLEN("infobackground") },
+	{ "infotext", SLEN("infotext") },
+	{ "menu", SLEN("menu") },
+	{ "menutext", SLEN("menutext") },
+	{ "scrollbar", SLEN("scrollbar") },
+	{ "threeddarkshadow", SLEN("threeddarkshadow") },
+	{ "threedface", SLEN("threedface") },
+	{ "threedhighlight", SLEN("threedhighlight") },
+	{ "threedlightshadow", SLEN("threedlightshadow") },
+	{ "threedshadow", SLEN("threedshadow") },
+	{ "window", SLEN("window") },
+	{ "windowframe", SLEN("windowframe") },
+	{ "windowtext", SLEN("windowtext") }
 };
 
 
Index: libcss/src/parse/properties/utils.c
===================================================================
--- libcss/src/parse/properties/utils.c	(revision 10731)
+++ libcss/src/parse/properties/utils.c	(working copy)
@@ -12,6 +12,38 @@
 #include "bytecode/opcodes.h"
 #include "parse/properties/utils.h"
 
+uint32_t libcss_system_ui_colormap[28] = {
+	0x0000FF00, /* ActiveBorder */
+	0x00FF0000, /* ActiveCaption */
+	0xFF000000, /* AppWorkspace */
+	0x00FFFF00, /* Background */
+	0xFFFF0000, /* ButtonFace */
+	0x00000000, /* ButtonHighlight */
+	0x00000000, /* ButtonShadow */
+	0x00000000, /* ButtonText */
+	0x00000000, /* CaptionText */
+	0x00000000, /* GrayText */
+	0x00000000, /* Highlight */
+	0x00000000, /* HighlightText */
+	0x00000000, /* InactiveBorder */
+	0x00000000, /* InactiveCaption */
+	0x00000000, /* InactiveCaptionText */
+	0x00000000, /* InfoBackground */
+	0x00000000, /* InfoText */
+	0x00000000, /* Menu */
+	0x00000000, /* MenuText */
+	0x00000000, /* Scrollbar */
+	0x00000000, /* ThreeDDarkShadow */
+	0x00000000, /* ThreeDFace */
+	0x00000000, /* ThreeDHighlight */
+	0x00000000, /* ThreeDLightShadow */
+	0x00000000, /* ThreeDShadow */
+	0x00000000, /* Window */
+	0x00000000, /* WindowFrame */
+	0x00000000 /* WindowText */
+};
+
+
 /**
  * Parse a colour specifier
  *
@@ -167,6 +199,36 @@
 }
 
 /**
+ * Parse a named system ui colour
+ *
+ * \param c       Parsing context
+ * \param data    Colour name string
+ * \param result  Pointer to location to receive result
+ * \return CSS_OK      on success,
+ *         CSS_INVALID if the colour name is unknown
+ */
+css_error parse_system_ui_colour(css_language *c, lwc_string *data,
+		uint32_t *result)
+{
+	
+	int i;
+	bool match;
+
+	for (i = FIRST_SYSTEM_COLOUR; i <= LAST_SYSTEM_COLOUR; i++) {
+          if (lwc_string_caseless_isequal(data, c->strings[i],
+                                          &match) == lwc_error_ok &&
+				match)
+			break;
+	}
+	if (i == LAST_SYSTEM_COLOUR + 1)
+		return CSS_INVALID;
+
+	*result = libcss_system_ui_colormap[i - FIRST_SYSTEM_COLOUR];
+
+	return CSS_OK;
+}
+
+/**
  * Parse a named colour
  *
  * \param c       Parsing context
@@ -340,7 +402,7 @@
 			break;
 	}
 	if (i == LAST_COLOUR + 1)
-		return CSS_INVALID;
+		return parse_system_ui_colour(c, data, result);
 
 	*result = colourmap[i - FIRST_COLOUR];
 
Index: libcss/src/parse/properties/utils.h
===================================================================
--- libcss/src/parse/properties/utils.h	(revision 10731)
+++ libcss/src/parse/properties/utils.h	(working copy)
@@ -10,6 +10,8 @@
 
 #include "parse/language.h"
 
+extern uint32_t libcss_system_ui_colormap[28];
+
 css_error parse_colour_specifier(css_language *c,
 		const parserutils_vector *vector, int *ctx,
 		uint32_t *result);
Index: netsurf/beos/beos_gui.h
===================================================================
--- netsurf/beos/beos_gui.h	(revision 10731)
+++ netsurf/beos/beos_gui.h	(working copy)
@@ -64,3 +64,5 @@
 void nsbeos_gui_view_source(struct hlcache_handle *content, struct selection *selection);
 image_id nsbeos_find_app_path(char *path);
 
+void nsbeos_update_system_ui_colors(void);
+
Index: netsurf/beos/beos_window.cpp
===================================================================
--- netsurf/beos/beos_window.cpp	(revision 10731)
+++ netsurf/beos/beos_window.cpp	(working copy)
@@ -155,6 +155,7 @@
 		case B_PASTE:
 		case B_SELECT_ALL:
 		//case B_MOUSE_WHEEL_CHANGED:
+		case B_UI_SETTINGS_CHANGED:
 		// NetPositive messages
 		case B_NETPOSITIVE_OPEN_URL:
 		case B_NETPOSITIVE_BACK:
@@ -887,6 +888,9 @@
 			break;
 		case B_MOUSE_WHEEL_CHANGED:
 			break;
+		case B_UI_SETTINGS_CHANGED:
+			nsbeos_update_system_ui_colors();
+			break;
 		case 'nsLO': // login
 		{
 			BString url;
Index: netsurf/beos/beos_scaffolding.h
===================================================================
--- netsurf/beos/beos_scaffolding.h	(revision 10731)
+++ netsurf/beos/beos_scaffolding.h	(working copy)
@@ -23,7 +23,12 @@
 #include <View.h>
 #include <Window.h>
 #include <NetPositive.h>
+#include <BeBuild.h>
 
+#ifndef B_BEOS_VERSION_DANO
+#define B_UI_SETTINGS_CHANGED '_UIC'
+#endif
+
 extern "C" {
 #include "desktop/gui.h"
 #include "desktop/plotters.h"
Index: netsurf/beos/beos_gui.cpp
===================================================================
--- netsurf/beos/beos_gui.cpp	(revision 10731)
+++ netsurf/beos/beos_gui.cpp	(working copy)
@@ -38,6 +38,7 @@
 #include <Mime.h>
 #include <Path.h>
 #include <Roster.h>
+#include <Screen.h>
 #include <String.h>
 
 extern "C" {
@@ -81,7 +82,71 @@
 #include "beos/beos_fetch_rsrc.h"
 #include "beos/beos_scaffolding.h"
 
+#if !defined(__HAIKU__) && !defined(B_BEOS_VERSION_DANO)
+/* more ui_colors... */
+#define B_PANEL_TEXT_COLOR ((color_which)10)
+#define B_DOCUMENT_BACKGROUND_COLOR ((color_which)11)
+#define B_DOCUMENT_TEXT_COLOR ((color_which)12)
+#define B_CONTROL_BACKGROUND_COLOR ((color_which)13)
+#define B_CONTROL_TEXT_COLOR ((color_which)14)
+#define B_CONTROL_BORDER_COLOR ((color_which)15)
+#define B_CONTROL_HIGHLIGHT_COLOR ((color_which)16)
+#define B_NAVIGATION_BASE_COLOR ((color_which)4)
+#define B_NAVIGATION_PULSE_COLOR ((color_which)17)
+#define B_SHINE_COLOR ((color_which)18)
+#define B_SHADOW_COLOR ((color_which)19)
+#define B_MENU_SELECTED_BORDER_COLOR ((color_which)9)
+#define B_TOOLTIP_BACKGROUND_COLOR ((color_which)20)
+#define B_TOOLTIP_TEXT_COLOR ((color_which)21)
+#define B_SUCCESS_COLOR ((color_which)100)
+#define B_FAILURE_COLOR ((color_which)101)
+#define B_MENU_SELECTED_BACKGROUND_COLOR B_MENU_SELECTION_BACKGROUND_COLOR
+#define B_RANDOM_COLOR ((color_which)0x80000000)
+#define B_MICHELANGELO_FAVORITE_COLOR ((color_which)0x80000001)
+#define B_DSANDLER_FAVORITE_SKY_COLOR ((color_which)0x80000002)
+#define B_DSANDLER_FAVORITE_INK_COLOR ((color_which)0x80000003)
+#define B_DSANDLER_FAVORITE_SHOES_COLOR ((color_which)0x80000004)
+#define B_DAVE_BROWN_FAVORITE_COLOR ((color_which)0x80000005)
+#endif
+#define NOCOL ((color_which)0)
 
+#ifndef B_BEOS_VERSION_DANO
+#define B_UI_SETTINGS_CHANGED '_UIC'
+#endif
+
+extern "C" uint32_t libcss_system_ui_colormap[28];
+color_which system_ui_colors[28] = {
+	NOCOL,	/* ActiveBorder */
+	B_WINDOW_TAB_COLOR,	/* ActiveCaption */
+	B_PANEL_BACKGROUND_COLOR,	/* AppWorkspace */
+	B_DESKTOP_COLOR,	/* Background */
+	B_CONTROL_BACKGROUND_COLOR,	/* ButtonFace */
+	B_CONTROL_HIGHLIGHT_COLOR,	/* ButtonHighlight */
+	NOCOL,	/* ButtonShadow */
+	B_CONTROL_TEXT_COLOR,	/* ButtonText */
+	NOCOL,	/* CaptionText */
+	NOCOL,	/* GrayText */
+	NOCOL,	/* Highlight */
+	NOCOL,	/* HighlightText */
+	NOCOL,	/* InactiveBorder */
+	NOCOL,	/* InactiveCaption */
+	NOCOL,	/* InactiveCaptionText */
+	B_TOOLTIP_BACKGROUND_COLOR,	/* InfoBackground */
+	B_TOOLTIP_TEXT_COLOR,	/* InfoText */
+	B_MENU_BACKGROUND_COLOR,	/* Menu */
+	B_MENU_ITEM_TEXT_COLOR,	/* MenuText */
+	NOCOL,	/* Scrollbar */
+	NOCOL,	/* ThreeDDarkShadow */
+	NOCOL,	/* ThreeDFace */
+	NOCOL,	/* ThreeDHighlight */
+	NOCOL,	/* ThreeDLightShadow */
+	NOCOL,	/* ThreeDShadow */
+	B_DOCUMENT_BACKGROUND_COLOR,	/* Window */
+	NOCOL,	/* WindowFrame */
+	B_DOCUMENT_TEXT_COLOR	/* WindowText */
+};
+
+
 static void *myrealloc(void *ptr, size_t len, void *pw);
 void gui_init(int argc, char** argv);
 
@@ -281,6 +346,20 @@
 }
 #endif
 
+void nsbeos_update_system_ui_colors(void)
+{
+	int i;
+	for (i = 0; i < 28; i++) {
+		rgb_color c = ui_color(system_ui_colors[i]);
+		if (system_ui_colors[i] == B_DESKTOP_COLOR) {
+			BScreen s;
+			//c = s.DesktopColor();
+		}
+		printf("uic[%d]: %02x %02x %02x %02x\n", i, c.red, c.green, c.blue, c.alpha);
+		libcss_system_ui_colormap[i] = ((((uint32_t)c.red << 24) & 0xff000000) | ((c.green << 16) & 0x00ff0000) | ((c.blue << 8) & 0x0000ff00));
+	}
+}
+
 /* realpath fallback on R5 */
 #if !defined(__HAIKU__) && !defined(B_BEOS_VERSION_DANO)
 extern "C" char *realpath(const char *f, char *buf);
@@ -488,6 +567,8 @@
 			return;
 	}
 
+	nsbeos_update_system_ui_colors();
+
 	fetch_rsrc_register();
 
 	check_homedir();
Index: netsurf/beos/beos_scaffolding.cpp
===================================================================
--- netsurf/beos/beos_scaffolding.cpp	(revision 10731)
+++ netsurf/beos/beos_scaffolding.cpp	(working copy)
@@ -705,6 +705,9 @@
 			}
 			break;
 		}
+		case B_UI_SETTINGS_CHANGED:
+			nsbeos_update_system_ui_colors();
+			break;
 		case B_NETPOSITIVE_OPEN_URL:
 		{
 			int32 i;
