From 705d9f78767e19b074d34c215c49bc20a7ba5852 Mon Sep 17 00:00:00 2001 From: Jacques Erasmus Date: Thu, 12 Sep 2019 23:36:27 +0000 Subject: Replace JS table selectors with CSS Replaced the JS solution for targeting tables --- content/assets/javascripts/table-display-block.js | 10 ---------- content/assets/stylesheets/stylesheet.scss | 6 ++++++ 2 files changed, 6 insertions(+), 10 deletions(-) delete mode 100644 content/assets/javascripts/table-display-block.js (limited to 'content/assets') diff --git a/content/assets/javascripts/table-display-block.js b/content/assets/javascripts/table-display-block.js deleted file mode 100644 index 68ec21649..000000000 --- a/content/assets/javascripts/table-display-block.js +++ /dev/null @@ -1,10 +0,0 @@ ---- -version: 2 ---- - -var tableList = document.querySelectorAll('.js-article-content table'); -tableList.forEach( - function(table) { - table.classList.add('display-block'); - } -); diff --git a/content/assets/stylesheets/stylesheet.scss b/content/assets/stylesheets/stylesheet.scss index df0dde512..a9864aecf 100644 --- a/content/assets/stylesheets/stylesheet.scss +++ b/content/assets/stylesheets/stylesheet.scss @@ -98,6 +98,12 @@ table { } } +// this targets tables where the `table_display_block: true` attribute is present +// for more information: https://docs.gitlab.com/ee/development/documentation/styleguide.html#tables-overlapping-the-toc +.table-display-block table { + display: block; +} + blockquote { background-color: $blockquote-background-color; color: $blockquote-txt-color; -- cgit v1.2.3