RedditPostBoundaryStyle.swift 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. import Foundation
  2. enum RedditPostBoundaryStyle {
  3. static let injectionScript = """
  4. (function() {
  5. const STYLE_ID = 'reddora-post-boundary-style';
  6. if (document.getElementById(STYLE_ID)) return;
  7. const style = document.createElement('style');
  8. style.id = STYLE_ID;
  9. style.textContent = `
  10. shreddit-post:not([promoted]):not([data-promoted="true"]),
  11. article[data-testid="post-container"] {
  12. box-sizing: border-box !important;
  13. border: 1px solid rgba(255, 255, 255, 0.08) !important;
  14. border-radius: 12px !important;
  15. background-color: rgba(255, 255, 255, 0.02) !important;
  16. box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03) !important;
  17. margin-block: 10px !important;
  18. overflow: visible !important;
  19. }
  20. shreddit-post:not([promoted]):not([data-promoted="true"])::part(post),
  21. shreddit-post:not([promoted]):not([data-promoted="true"]) [slot="post"] {
  22. border-radius: 12px !important;
  23. }
  24. `;
  25. (document.head || document.documentElement).appendChild(style);
  26. })();
  27. """
  28. }