Skip to content

Commit 74ac7ce

Browse files
authored
Merge pull request #369 from Haroenv/feat/jquery-typography
refactor(jquery): remove from typography page
2 parents 8e65bb2 + a9c5257 commit 74ac7ce

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

core/js/styleguide-typography.js

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
import $ from 'jquery';
2-
3-
const $typographyEntries = $('#component-typography tbody tr');
1+
const typographyEntries = document.querySelectorAll('#component-typography tbody tr');
42

53
function calculateFontSizes() {
6-
$typographyEntries.each(function () {
7-
const $fontSizeInfo = $(this).find('.br-typography-sample-size');
8-
const fontSizeForElement = $(this).find('.br-typography-sample-content').children().first().css('font-size');
9-
$fontSizeInfo.text(fontSizeForElement);
4+
typographyEntries.forEach(function (element) {
5+
const fontSizeInfo = element.querySelector('.br-typography-sample-size');
6+
const fontSizeForElement = getComputedStyle(element.querySelector('.br-typography-sample-content').children[0])['font-size'];
7+
fontSizeInfo.innerText = fontSizeForElement;
108
});
119
}
1210

0 commit comments

Comments
 (0)