diff options
author | Filip Zybała <fzybala@virtuslab.com> | 2020-03-26 17:17:17 +0100 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-03-31 14:45:37 +0200 |
commit | c29d660242027eb23ff9c5d7c176eb188abcef74 (patch) | |
tree | e1189c600012f98f93815ee196f0e21498c50c7a /core/src | |
parent | a8f8ac319de698528c04db9ebeceb986a8ced7f0 (diff) | |
download | dokka-c29d660242027eb23ff9c5d7c176eb188abcef74.tar.gz dokka-c29d660242027eb23ff9c5d7c176eb188abcef74.tar.bz2 dokka-c29d660242027eb23ff9c5d7c176eb188abcef74.zip |
Added platformTags rendering. Provided simple css classes. TODO adjust css, add onHover
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/kotlin/pages/ContentNodes.kt | 9 | ||||
-rw-r--r-- | core/src/main/resources/dokka/styles/style.css | 73 |
2 files changed, 81 insertions, 1 deletions
diff --git a/core/src/main/kotlin/pages/ContentNodes.kt b/core/src/main/kotlin/pages/ContentNodes.kt index 46a71bc0..03014530 100644 --- a/core/src/main/kotlin/pages/ContentNodes.kt +++ b/core/src/main/kotlin/pages/ContentNodes.kt @@ -167,7 +167,14 @@ interface Style interface Kind enum class ContentKind : Kind { - Comment, Constructors, Functions, Parameters, Properties, Classlikes, Packages, Symbol, Sample, Main, BriefComment, Empty + Comment, Constructors, Functions, Parameters, Properties, Classlikes, Packages, Symbol, Sample, Main, BriefComment, Empty; + + companion object{ + fun shouldBePlatformTagged(kind: Kind) : Boolean { + val platformTagged = listOf(Constructors, Functions, Parameters, Properties, Classlikes, Packages) + return platformTagged.contains(kind) + } + } } enum class TextStyle : Style { diff --git a/core/src/main/resources/dokka/styles/style.css b/core/src/main/resources/dokka/styles/style.css index 46a78467..1fa74ca4 100644 --- a/core/src/main/resources/dokka/styles/style.css +++ b/core/src/main/resources/dokka/styles/style.css @@ -348,6 +348,79 @@ footer { bottom: 50px; } +.platform-tagged { + flex: auto; + display: flex; + flex-direction: row-reverse; + padding: 0px; +} + +.platform-tag { + display: flex; + justify-content: center; + flex-direction: row; + padding: 4px 8px; + + width: 67px; + height: 24px; + right: 0px; + top: 0px; + + background: #F4F4F4; + border-radius: 100px; + + flex: none; + order: 0 + align--self: end; +} + +.platform-tagged > .platform-tag { + align-self: center; +} + +.platform-tag.jvm { + border: crimson; + border-style: solid; + border-width: 1px; + border-color: crimson; + background-color: crimson; + color: white; +} + +.platform-tag.js { + border: orange; + border-style: solid; + border-width: 1px; + border-color: orange; + background-color: orange; + color: white; +} + +.platform-tag.native { + border: blue; + border-style: solid; + border-width: 1px; + border-color: blue; + background-color: blue; + color: white; +} + +.platform-tag.common { + border: gray; + border-style: solid; + border-width: 1px; + border-color: gray; + color: gray; + background-color: gray; + color: white; +} + +.platform-tagged > .content { + display: block; + + flex: auto; +} + @media print, screen and (max-width: 960px) { div.wrapper { |