Browse Source

lit: view-source float right

Simon Legner 1 month ago
parent
commit
5fdeff7c5c
2 changed files with 18 additions and 6 deletions
  1. 11 6
      assets/stylesheets/pages/_lit.scss
  2. 7 0
      lib/docs/filters/lit/clean_html.rb

+ 11 - 6
assets/stylesheets/pages/_lit.scss

@@ -1,25 +1,30 @@
 ._lit {
 ._lit {
   @extend %simple;
   @extend %simple;
 
 
-  h4 { @extend %block-label, %label-blue; }
+  h4 {
+    @extend %block-label, %label-blue;
+  }
 
 
+  .view-source {
+    float: right;
+  }
   .propertyDetails {
   .propertyDetails {
-    padding-left:1.5em
+    padding-left: 1.5em;
   }
   }
   .heading.property {
   .heading.property {
-    margin-top:2em
+    margin-top: 2em;
   }
   }
   .heading.property > h4 {
   .heading.property > h4 {
-    font-weight:400
+    font-weight: 400;
   }
   }
   .newKeyword,
   .newKeyword,
   .readonlyKeyword,
   .readonlyKeyword,
   .staticKeyword {
   .staticKeyword {
-    font-style:italic
+    font-style: italic;
   }
   }
   .functionName,
   .functionName,
   .propertyName {
   .propertyName {
-    font-weight:700
+    font-weight: 700;
   }
   }
   aside.litdev-aside {
   aside.litdev-aside {
     display: flex;
     display: flex;

+ 7 - 0
lib/docs/filters/lit/clean_html.rb

@@ -64,6 +64,13 @@ module Docs
           h.prepend_child(kindtag)
           h.prepend_child(kindtag)
         end
         end
 
 
+        # View source
+        css('h2 ~ a.viewSourceLink, h3 ~ a.viewSourceLink, h4 ~ a.viewSourceLink').each do |node|
+          node['class'] = 'view-source'
+          node.content = 'Source'
+          node.previous_element << node
+        end
+
         doc
         doc
       end
       end
     end
     end