NPM Resource Changed ? Pending

User tests: Successful: Unsuccessful:

avatar chang-zhao
chang-zhao
17 Dec 2019

Pull Request for Issue #27297 .

Summary of Changes

Replacing the usage of some inline styles (especially "display: none" /"display: block") with consistent usage of .classList.add('hidden') / .remove / .toggle, in order to reduce 'unsafe-inline' styles which hinder Content-Security-Policy.

Testing Instructions

Hiding and unhiding elements should behave properly.

Expected result

Actual result

Documentation Changes Required

The class .table-row { display: table-row} has been added to the templates.

avatar chang-zhao chang-zhao - open - 17 Dec 2019
avatar chang-zhao chang-zhao - change - 17 Dec 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 17 Dec 2019
Category Administration com_banners com_categories com_contact com_content com_fields com_joomlaupdate com_languages com_menus com_modules com_newsfeeds com_plugins com_tags com_users com_workflow Templates (admin) JavaScript Repository NPM Change
avatar brianteeman
brianteeman - comment - 17 Dec 2019

Thank you for making your first pull request to Joomla

avatar chang-zhao chang-zhao - change - 17 Dec 2019
Labels Added: NPM Resource Changed ?
avatar brianteeman
brianteeman - comment - 21 Dec 2019

What about all the table header th with style="width:xx%"
Should these go as well. If so then perhaps with a helper class w1, w5, w10, w33 etc

avatar chang-zhao
chang-zhao - comment - 21 Dec 2019

What about all the table header th with style="width:xx%"
Should these go as well. If so then perhaps with a helper class w1, w5, w10, w33 etc

Yes. I think it might go in a next patch. Tailwind CSS library is a popular tool for adding such atomic classes, and it uses a particular system for naming them:

https://tailwindcss.com/docs/width/

I think we could use the same standard, to keep it from confusions:


.w-1/100 { width: 1% }
.w-1/10 { width: 10% }
.w-1/3 { width: 33% }
.w-4/10 { width: 40% }

and the like.

PS (14:01 GMT). It's a bit of inconvenience though that in .css and in js selectors slashes should be escaped, like this: .w-1\/10 — but not in HTML.

avatar Quy
Quy - comment - 21 Dec 2019

Bootstrap includes support for 25% w-25, 50% w-50, 75% w-75, 100% w-100, and auto w-auto by default.
https://getbootstrap.com/docs/4.4/utilities/sizing/

avatar chang-zhao
chang-zhao - comment - 21 Dec 2019

@Quy, yes, that system is probably better (though sometimes some confusion might happen as Joomla had classes like .width-50 { width: 50px }, but I think it's alright).

avatar wilsonge wilsonge - close - 23 Dec 2019
avatar wilsonge wilsonge - merge - 23 Dec 2019
avatar wilsonge wilsonge - change - 23 Dec 2019
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-12-23 12:21:22
Closed_By wilsonge
avatar wilsonge
wilsonge - comment - 23 Dec 2019

Think just keeping this to hidden classes is fine for this patch. So merging this.

Thanks for your first PR to Joomla!!

avatar Quy
Quy - comment - 23 Dec 2019

@chang-zhao Please fix admin login form not displaying.

27298

avatar chang-zhao
chang-zhao - comment - 23 Dec 2019

@chang-zhao Please fix admin login form not displaying.

#27343

avatar xillibit
xillibit - comment - 28 Dec 2019

@chang-zhao Please fix admin login form not displaying.

#27343

How it's intented to works ? The fields username and password are still not displayed

notitre

avatar Quy
Quy - comment - 28 Dec 2019

@xillibit Are you testing with the nightly build? https://developer.joomla.org/nightly-builds.html

avatar xillibit
xillibit - comment - 28 Dec 2019

my Joomla! 4.0 install is a git clone of 4.0-dev tree and i just updated before posting my comment above

avatar Quy
Quy - comment - 28 Dec 2019

#27343 fixed this issue. Try clearing your browser's cache.

avatar 810
810 - comment - 28 Dec 2019

same for me, its always hidden. Why is there a hidden class on the form.

avatar xillibit
xillibit - comment - 30 Dec 2019

It was a false alarm, i deleted my Joomla! and re-done a clean install, now it works

Add a Comment

Login with GitHub to post a comment