       (add-item 'fstar-customize "settings"))
     (fstar-tool-bar--cleanup-map map)))
 
-(defconst fstar-tool-bar--icons-directory
-  (let ((shade (pcase frame-background-mode (`dark 'light) (_ 'dark))))
-    (expand-file-name (format "etc/icons/%S" shade) fstar--directory)))
-
 (defun fstar-setup-tool-bar ()
   "Display the F* toolbar."
-  (setq-local tool-bar-map fstar-tool-bar--map)
-  (setq-local image-load-path `(,fstar-tool-bar--icons-directory ,@image-load-path)))
+  (setq-local tool-bar-map fstar-tool-bar--map))
 
 (defun fstar-teardown-tool-bar ()
   "Hide the F* toolbar."
-  (kill-local-variable 'tool-bar-map)
-  (kill-local-variable 'image-load-path))
+  (kill-local-variable 'tool-bar-map))
 
 ;;; Main mode
 

   command nil map fstar-mode-map
   :vert-only t :fstar-icon icon))

(defun fstar-tool-bar--cleanup-binding (binding)
  "Recompute :image spec in toolbar entry BINDING."
  (pcase binding

     (-when-let* ((img (plist-get props :fstar-icon)))
       (let ((specs nil))
         (dolist (type '(xpm png svg))
           (let* ((fname (format "%s.%S" img type))
                  (fpath (expand-file-name fname fstar-tool-bar--icons-directory)))
             (push `(:type ,type :file ,fpath) specs)))
         (setq props (plist-put props :image `(find-image '(,@specs))))))
     `(,key menu-item ,doc ,cmd . ,props))
    (_ binding)))
