Confluence: Simple Floating ToC

Makes widget from macro "Table of Contents" float on the right hand side of content.

目前为 2023-01-11 提交的版本。查看 最新版本

  1. /* ==UserStyle==
  2. @name Confluence: Simple Floating ToC
  3. @description Makes widget from macro "Table of Contents" float on the right hand side of content.
  4. @version 1
  5. @author Andrei Rybak
  6. @homepageURL https://github.com/rybak/atlassian-tweaks
  7. @license MIT
  8. @namespace github.com/openstyles/stylus
  9. @preprocessor uso
  10. @var text yourDomain "Custom Confluence domain" "confluence.example.com"
  11. @var text yourDomain2 "Second Custom Confluence domain" "confluence.example.net"
  12. @var number SFTRightMargin "Margin on the right side of ToC, em" [2, 1, 20, 1, "em"]
  13. @var number SFTContentWidth "Width of main content, percent" [75, 1, 100, 1, "%"]
  14. @var number SFTTocWidth "Width of table of contents, percent" [20, 1, 100, 1, "%"]
  15. ==/UserStyle== */
  16.  
  17. /*
  18. * Copyright (c) 2023 Andrei Rybak
  19. *
  20. * Permission is hereby granted, free of charge, to any person obtaining a copy
  21. * of this software and associated documentation files (the "Software"), to deal
  22. * in the Software without restriction, including without limitation the rights
  23. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  24. * copies of the Software, and to permit persons to whom the Software is
  25. * furnished to do so, subject to the following conditions:
  26. *
  27. * The above copyright notice and this permission notice shall be included in all
  28. * copies or substantial portions of the Software.
  29. *
  30. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  31. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  32. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  33. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  34. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  35. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  36. * SOFTWARE.
  37. */
  38.  
  39. @-moz-document url-prefix("https://confluence"), domain(/*[[yourDomain]]*/), domain(/*[[yourDomain2]]*/) {
  40. #main-content, #comments-section {
  41. width: /*[[SFTContentWidth]]*/;
  42. }
  43.  
  44. .toc-macro > ul {
  45. position: fixed;
  46. top: 6em;
  47. right: /*[[SFTRightMargin]]*/;
  48. width: /*[[SFTTocWidth]]*/;
  49. }
  50. }