[epiphany] Use "font: menu" to obtain the system interface font in CSS



commit eafd7234dabcbfebec11e4c1245b94f847cbb669
Author: Adrian Perez de Castro <aperez igalia com>
Date:   Tue Jun 6 20:05:56 2017 +0300

    Use "font: menu" to obtain the system interface font in CSS
    
    This uses "font: menu" rules to pick the font configured to be used by GTK+
    instead of hardcoding the "Cantarell" value.
    
    Note that the CSS spec mandates that when "font: menu" is to be used, no
    other properties (e.g. font size) can be specified as part of the "font"
    attribute, and "font-size" attributes had to be added to change sizes.
    
    This makes the following pages which are displayed by Epiphany inside
    web views use the same font as the rest of GTK+:
    
      - New tab/window overview page.
      - Error pages.
      - about:
      - about:plugins
      - about:applications
    
    Fixes bug #783489

 src/resources/about.css |   11 +++++++----
 src/resources/error.css |    5 +++--
 2 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/src/resources/about.css b/src/resources/about.css
index 48ea590..23c7290 100644
--- a/src/resources/about.css
+++ b/src/resources/about.css
@@ -7,8 +7,9 @@ h1 {
 }
 
 html {
-        font-family: Cantarell, sans-serif;
-        font: 11pt cantarell;
+        /* Pick system UI font and its properties, and then customize its size. */
+        font: menu;
+        font-size: 11pt;
         color: #2e3436;
         padding: 20px 20px 0 20px;
         background-color: #f6f6f4;
@@ -232,7 +233,8 @@ html.epiphany-html {
     display: inline-block;
     margin-top: 10px;
     overflow: hidden;
-    font-family: Cantarell, sans-serif;
+    /* Pick system UI font and its properties, and then customize its size. */
+    font: menu;
     font-size: 11pt;
     color: #2e3436;
     text-overflow: ellipsis;
@@ -268,7 +270,8 @@ html.epiphany-html {
     opacity: 0;
     z-index: 5;
     color: #888;
-    font-family: sans-serif;
+    /* Pick system UI font and its properties, and then customize its size. */
+    font: menu;
     font-size: 14px;
     width: 13px;
     height: 14px;
diff --git a/src/resources/error.css b/src/resources/error.css
index ffc508f..aeab318 100644
--- a/src/resources/error.css
+++ b/src/resources/error.css
@@ -1,8 +1,9 @@
 /* Global CSS for error pages */
 
 html {
-    font-family: Cantarell, sans-serif;
-    font: 12pt cantarell;
+    /* Pick system UI font and its properties, and then customize its size. */
+    font: menu;
+    font-size: 12pt;
     padding: 40px 20px 0 20px;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]