Browse Source

feat: Add is-linux ui class

Calum Lind 2 years ago
parent
commit
ae683159fb
2 changed files with 4 additions and 0 deletions
  1. 1 0
      src/main/frontend/ui.cljs
  2. 3 0
      src/main/frontend/util.cljc

+ 1 - 0
src/main/frontend/ui.cljs

@@ -353,6 +353,7 @@
     (when config/publishing? (.add cl "is-publish-mode"))
     (when util/mac? (.add cl "is-mac"))
     (when util/win32? (.add cl "is-win32"))
+    (when util/linux? (.add cl "is-linux"))
     (when (util/electron?) (.add cl "is-electron"))
     (when (util/ios?) (.add cl "is-ios"))
     (when (util/mobile?) (.add cl "is-mobile"))

+ 3 - 0
src/main/frontend/util.cljc

@@ -915,6 +915,9 @@
 (defonce win32? #?(:cljs goog.userAgent/WINDOWS
                    :clj nil))
 
+(defonce linux? #?(:cljs goog.userAgent/LINUX
+                   :clj nil))
+
 (defn default-content-with-title
   [text-format]
   (case (name text-format)