Skip to main content

Highlight sections in teux-deux

28th October, 2022

Updated: 28th October, 2022

const results = []; 
[...document.querySelectorAll('article img')].map((img, i) => {
	results.push(img.getAttribute('srcset')); 	
})
const todoList = document.querySelectorAll('.todo__list-item');
const sectionTest = new RegExp('^---.*---$');
[...todoList].map((todoListItem,i) => {
		const todoListItemTitle = todoListItem.querySelector('.todo-content__text');
		if(todoListItemTitle && todoListItemTitle.textContent && sectionTest.test(todoListItemTitle.textContent)) {
				todoListItem.style.backgroundColor = "var(--custom-color-light)"
				todoListItem.style.color = "var(--custom-color-light-text)"
				todoListItem.style.textAlign = "center"
				console.log(todoListItem)
		}
	}
);

d88ebe57-bdcf-40d5-b9f8-91fe22f57bd7

Created on: 28th October, 2022

Last updated: 28th October, 2022