openhands commited on
Commit
74f33aa
·
1 Parent(s): 0e8d4cc

Remove glow from OpenHands logo in dark mode plots

Browse files

- Add #openhands-logo fragment to logo data URIs for CSS targeting
- Update CSS to exclude OpenHands logo from glow effect using :not() selector
- Company logos still get the glow for visibility in dark mode
- OpenHands branding logo renders cleanly without glow

Files changed (3) hide show
  1. content.py +9 -5
  2. leaderboard_transformer.py +11 -5
  3. visualizations.py +11 -5
content.py CHANGED
@@ -1145,16 +1145,20 @@ h3 .header-link-icon {
1145
 
1146
  /* Re-invert company logo images so they display correctly */
1147
  /* Also add a light gray circular glow behind them for visibility */
1148
- .dark .js-plotly-plot .layer-above image,
1149
- .dark .js-plotly-plot .imagelayer image {
 
1150
  filter: invert(1) hue-rotate(180deg)
1151
  drop-shadow(0 0 12px rgba(160, 165, 180, 0.95))
1152
  drop-shadow(0 0 8px rgba(160, 165, 180, 0.9));
1153
  }
1154
 
1155
- /* Re-invert the OpenHands logo at bottom - no glow needed as it's designed for dark backgrounds */
1156
- .dark .js-plotly-plot image[xlink\\:href*="openhands"],
1157
- .dark .js-plotly-plot image[href*="openhands"] {
 
 
 
1158
  filter: invert(1) hue-rotate(180deg) !important;
1159
  }
1160
 
 
1145
 
1146
  /* Re-invert company logo images so they display correctly */
1147
  /* Also add a light gray circular glow behind them for visibility */
1148
+ /* Exclude OpenHands logo (identified by #openhands-logo fragment in href) */
1149
+ .dark .js-plotly-plot .layer-above image:not([href*="openhands-logo"]):not([xlink\\:href*="openhands-logo"]),
1150
+ .dark .js-plotly-plot .imagelayer image:not([href*="openhands-logo"]):not([xlink\\:href*="openhands-logo"]) {
1151
  filter: invert(1) hue-rotate(180deg)
1152
  drop-shadow(0 0 12px rgba(160, 165, 180, 0.95))
1153
  drop-shadow(0 0 8px rgba(160, 165, 180, 0.9));
1154
  }
1155
 
1156
+ /* OpenHands logo at bottom - no glow, just re-invert for dark mode */
1157
+ /* The logo is identified by #openhands-logo fragment in the data URI */
1158
+ .dark .js-plotly-plot .layer-above image[href*="openhands-logo"],
1159
+ .dark .js-plotly-plot .layer-above image[xlink\\:href*="openhands-logo"],
1160
+ .dark .js-plotly-plot .imagelayer image[href*="openhands-logo"],
1161
+ .dark .js-plotly-plot .imagelayer image[xlink\\:href*="openhands-logo"] {
1162
  filter: invert(1) hue-rotate(180deg) !important;
1163
  }
1164
 
leaderboard_transformer.py CHANGED
@@ -40,7 +40,8 @@ COMPANY_LOGO_MAP = {
40
  }
41
 
42
  # OpenHands branding constants
43
- OPENHANDS_LOGO_PATH = "assets/openhands_logo_color_forwhite.png"
 
44
  OPENHANDS_URL = "https://index.openhands.dev"
45
 
46
  # URL annotation for bottom right of charts
@@ -62,13 +63,18 @@ URL_ANNOTATION = dict(
62
 
63
 
64
  def get_openhands_logo_image():
65
- """Get the OpenHands logo as a Plotly image dict for chart branding."""
66
- if os.path.exists(OPENHANDS_LOGO_PATH):
 
 
 
 
67
  try:
68
- with open(OPENHANDS_LOGO_PATH, "rb") as f:
69
  logo_data = base64.b64encode(f.read()).decode('utf-8')
 
70
  return dict(
71
- source=f"data:image/png;base64,{logo_data}",
72
  xref="paper",
73
  yref="paper",
74
  x=0,
 
40
  }
41
 
42
  # OpenHands branding constants
43
+ OPENHANDS_LOGO_PATH_LIGHT = "assets/openhands_logo_color_forwhite.png"
44
+ OPENHANDS_LOGO_PATH_DARK = "assets/openhands_logo_color_forblack.png"
45
  OPENHANDS_URL = "https://index.openhands.dev"
46
 
47
  # URL annotation for bottom right of charts
 
63
 
64
 
65
  def get_openhands_logo_image():
66
+ """Get the OpenHands logo as a Plotly image dict for chart branding.
67
+
68
+ Uses a special URI format with #openhands-logo fragment to allow CSS targeting.
69
+ The fragment doesn't affect the image rendering but enables CSS selectors.
70
+ """
71
+ if os.path.exists(OPENHANDS_LOGO_PATH_LIGHT):
72
  try:
73
+ with open(OPENHANDS_LOGO_PATH_LIGHT, "rb") as f:
74
  logo_data = base64.b64encode(f.read()).decode('utf-8')
75
+ # Add #openhands-logo fragment to enable CSS targeting for dark mode handling
76
  return dict(
77
+ source=f"data:image/png;base64,{logo_data}#openhands-logo",
78
  xref="paper",
79
  yref="paper",
80
  x=0,
visualizations.py CHANGED
@@ -41,7 +41,8 @@ STANDARD_FONT = dict(
41
  )
42
 
43
  # OpenHands branding constants
44
- OPENHANDS_LOGO_PATH = "assets/openhands_logo_color_forwhite.png"
 
45
  OPENHANDS_URL = "https://index.openhands.dev"
46
 
47
  # URL annotation for bottom right of charts
@@ -63,13 +64,18 @@ URL_ANNOTATION = dict(
63
 
64
 
65
  def get_openhands_logo_image():
66
- """Get the OpenHands logo as a Plotly image dict for chart branding."""
67
- if os.path.exists(OPENHANDS_LOGO_PATH):
 
 
 
 
68
  try:
69
- with open(OPENHANDS_LOGO_PATH, "rb") as f:
70
  logo_data = base64.b64encode(f.read()).decode('utf-8')
 
71
  return dict(
72
- source=f"data:image/png;base64,{logo_data}",
73
  xref="paper",
74
  yref="paper",
75
  x=0,
 
41
  )
42
 
43
  # OpenHands branding constants
44
+ OPENHANDS_LOGO_PATH_LIGHT = "assets/openhands_logo_color_forwhite.png"
45
+ OPENHANDS_LOGO_PATH_DARK = "assets/openhands_logo_color_forblack.png"
46
  OPENHANDS_URL = "https://index.openhands.dev"
47
 
48
  # URL annotation for bottom right of charts
 
64
 
65
 
66
  def get_openhands_logo_image():
67
+ """Get the OpenHands logo as a Plotly image dict for chart branding.
68
+
69
+ Uses a special URI format with #openhands-logo fragment to allow CSS targeting.
70
+ The fragment doesn't affect the image rendering but enables CSS selectors.
71
+ """
72
+ if os.path.exists(OPENHANDS_LOGO_PATH_LIGHT):
73
  try:
74
+ with open(OPENHANDS_LOGO_PATH_LIGHT, "rb") as f:
75
  logo_data = base64.b64encode(f.read()).decode('utf-8')
76
+ # Add #openhands-logo fragment to enable CSS targeting for dark mode handling
77
  return dict(
78
+ source=f"data:image/png;base64,{logo_data}#openhands-logo",
79
  xref="paper",
80
  yref="paper",
81
  x=0,