Conversation
GuillaumeDua
left a comment
There was a problem hiding this comment.
Thanks for your contribution,
there are a few minor changes requested as review comment down below to make it great
Once accepted, we might reuse some of those file not only for divs_html_elements test but also others.
You might wanna move some folders :
styles/so it becomestests/styles/scripts/awesome-doc-configuration.jsso it becomes `tests/scripts/awesome-doc_default-configuration.js
and then, for reusability purpose, refactorhttps://github.com/GuillaumeDua/awesome-doc-code-sections/blob/ce4493eadb3d899e209f550a2acf8fb424d51f59/tests/per_usage/custom_html_elements/index.html so it also gets benefits from it.
| @@ -0,0 +1,26 @@ | |||
| let is_stylished = false; | |||
There was a problem hiding this comment.
I'd rather name that file "style-mutators" rather than "styling", so the purpose is explicit
| } | ||
|
|
||
| let is_small = false; | ||
| function toggle_small() { |
There was a problem hiding this comment.
toggle_small -> toggle_small_style
Right now, this function only works if toggle_style was called before.
An improvement here would be to add a simple if-then here, such as :
if (!is_stylished)
toggle_style()and modify toggle_style so when L7 it removes the classes, then it also reset sizes
L7 :
function (elements) {
elements.removeClass(`${stylished_classname}`);
if (is_small)
toggle_small()
}
I moved scripts into a separated folder "scripts", same for "styles" for CSS styles and restructured the HTML :