Browse Source

inspector: colors

mattias 3 weeks ago
parent
commit
865ab3f52d

+ 6 - 3
demo/Inspector/InspDemoStyles1.pas

@@ -44,6 +44,8 @@ begin
     Name:='CSSStyleInspector';
     Name:='CSSStyleInspector';
     Parent:=Body;
     Parent:=Body;
   end;
   end;
+
+  Stylesheet.Text:=':root { color: #fff; font-size: 15px; background-color: #333; }';
 end;
 end;
 
 
 procedure TDemoStylesWindow.ApplyCSS;
 procedure TDemoStylesWindow.ApplyCSS;
@@ -60,9 +62,10 @@ procedure TDemoStylesWindow.ApplyCSS;
 
 
 begin
 begin
   inherited ApplyCSS;
   inherited ApplyCSS;
-  writeln('TDemoStylesWindow.ApplyCSS START');
-  W('',Self);
-  writeln('TDemoStylesWindow.ApplyCSS END');
+
+  //writeln('TDemoStylesWindow.ApplyCSS START');
+  //W('',Self);
+  //writeln('TDemoStylesWindow.ApplyCSS END');
 end;
 end;
 
 
 end.
 end.

+ 7 - 6
demo/Inspector/fresnel.cssstyleinspector.pas

@@ -276,6 +276,7 @@ begin
   end;
   end;
   if DeclEl.IsImportant then
   if DeclEl.IsImportant then
     ValueTxt+=' !important';
     ValueTxt+=' !important';
+  ValueTxt+=';';
 
 
   Index:=0;
   Index:=0;
   if (DeclEl.KeyCount<>1) then
   if (DeclEl.KeyCount<>1) then
@@ -380,14 +381,14 @@ end;
 class function TCSSStyleInspector.GetCSSTypeStyle: TCSSString;
 class function TCSSStyleInspector.GetCSSTypeStyle: TCSSString;
 begin
 begin
   Result:=
   Result:=
-     '.'+RulesDivClass+' { font-color: white; background-color: #333 }'+LineEnding
-    //+'.'+RuleSelectorLabelClass+' {  }'+LineEnding
+     '.'+RulesDivClass+' { color: #fff; font-size: 15px; background-color: #333 }'+LineEnding
+    +'.'+RuleSelectorLabelClass+' { margin-right: 1ch; }'+LineEnding
     +'.'+RuleBracketLabelClass+' { font-weight: bold; }'+LineEnding
     +'.'+RuleBracketLabelClass+' { font-weight: bold; }'+LineEnding
-    //+'.'+RuleOriginLabelClass+' {  }'+LineEnding
+    +'.'+RuleOriginLabelClass+' { margin-left: 5ch; }'+LineEnding
     +'.'+RuleFooterDivClass+' { border-bottom: 1px solid #888; }'+LineEnding
     +'.'+RuleFooterDivClass+' { border-bottom: 1px solid #888; }'+LineEnding
-    +'.'+DeclDivClass+' { margin-left: 30px; }'+LineEnding
-    +'.'+DeclKeyLabelClass+' { font-color: cyan; }'+LineEnding
-    +'.'+DeclColonLabelClass+' { margin-right: 1em; }'+LineEnding
+    +'.'+DeclDivClass+' { margin-left: 2ch; }'+LineEnding
+    +'.'+DeclKeyLabelClass+' { color: cyan; }'+LineEnding
+    +'.'+DeclColonLabelClass+' { margin-right: 1ch; }'+LineEnding
     ;
     ;
 end;
 end;
 
 

+ 2 - 2
src/base/fresnel.dom.pas

@@ -9349,12 +9349,12 @@ begin
     cu_em: Result:=Font.GetSize; // todo
     cu_em: Result:=Font.GetSize; // todo
     cu_ex: Result:=Font.GetSize/2; // todo
     cu_ex: Result:=Font.GetSize/2; // todo
     cu_cap: Result:=Font.GetSize; // todo
     cu_cap: Result:=Font.GetSize; // todo
-    cu_ch: Result:=Font.GetSize; // todo
+    cu_ch: Result:=Font.GetSize/2; // todo
     // relative to root's font
     // relative to root's font
     cu_rem: Result:=Viewport.Font.GetSize; // todo
     cu_rem: Result:=Viewport.Font.GetSize; // todo
     cu_rex: Result:=Viewport.Font.GetSize/2; // todo
     cu_rex: Result:=Viewport.Font.GetSize/2; // todo
     cu_rcap: Result:=Viewport.Font.GetSize; // todo
     cu_rcap: Result:=Viewport.Font.GetSize; // todo
-    cu_rchh: Result:=Viewport.Font.GetSize; // todo
+    cu_rchh: Result:=Viewport.Font.GetSize/2; // todo
     // relative to default viewport size
     // relative to default viewport size
     cu_vw,cu_svw,cu_lvw,cu_dvw: Result:=Viewport.Width/100;
     cu_vw,cu_svw,cu_lvw,cu_dvw: Result:=Viewport.Width/100;
     cu_vh,cu_svh,cu_lvh,cu_dvh: Result:=Viewport.Height/100;
     cu_vh,cu_svh,cu_lvh,cu_dvh: Result:=Viewport.Height/100;