From 04317777fd385a7e9ab765acb57980229c39b418 Mon Sep 17 00:00:00 2001 From: Haroen Viaene Date: Wed, 9 Jun 2021 16:40:48 +0200 Subject: [PATCH 1/2] refactor(jquery): remove from typography page --- core/js/styleguide-typography.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/js/styleguide-typography.js b/core/js/styleguide-typography.js index 5617d2fa..0deded85 100644 --- a/core/js/styleguide-typography.js +++ b/core/js/styleguide-typography.js @@ -1,12 +1,10 @@ -import $ from 'jquery'; - -const $typographyEntries = $('#component-typography tbody tr'); +const typographyEntries = document.querySelectorAll('#component-typography tbody tr'); function calculateFontSizes() { - $typographyEntries.each(function () { - const $fontSizeInfo = $(this).find('.br-typography-sample-size'); - const fontSizeForElement = $(this).find('.br-typography-sample-content').children().first().css('font-size'); - $fontSizeInfo.text(fontSizeForElement); + typographyEntries.forEach(function (element) { + const fontSizeInfo = element.querySelector('.br-typography-sample-size'); + const fontSizeForElement = getComputedStyle(element.querySelector('.br-typography-sample-content').children[0])['font-size']; + fontSizeInfo.innerText = fontSizeForElement; }); } @@ -18,3 +16,5 @@ on_resize(function() { }); calculateFontSizes(); + + From a9c525786b93222e275492caf663ccf3bed8cd3b Mon Sep 17 00:00:00 2001 From: Haroen Viaene Date: Wed, 9 Jun 2021 16:42:30 +0200 Subject: [PATCH 2/2] Update core/js/styleguide-typography.js --- core/js/styleguide-typography.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/core/js/styleguide-typography.js b/core/js/styleguide-typography.js index 0deded85..107ad410 100644 --- a/core/js/styleguide-typography.js +++ b/core/js/styleguide-typography.js @@ -16,5 +16,3 @@ on_resize(function() { }); calculateFontSizes(); - -