? ? Success

User tests: Successful: Unsuccessful:

avatar roland-d
roland-d
3 Sep 2014

Currently it is impossible to use a custom.css file when using the Protostar template. A search on the net always ends up with a core hack of the index.php file, which could result in a problem when the index.php is being updated in a Joomla update.

This change checks if the file custom.css exists and if so, load it.

avatar roland-d roland-d - open - 3 Sep 2014
avatar jissues-bot jissues-bot - change - 3 Sep 2014
Labels Added: ?
avatar Bakual
Bakual - comment - 3 Sep 2014

A similar PR is open for the backend here: #3709

Personally I don't like using a custom.css and would rather use a plugin/module to do the same. There are many already existing which do exactly that and more.

avatar roland-d
roland-d - comment - 3 Sep 2014

Thanks @Bakual I did search but didn't find anything. Closing this in favor of #3709.

avatar roland-d roland-d - change - 3 Sep 2014
Closed_Date 0000-00-00 00:00:00 2014-09-03 10:21:38
avatar roland-d roland-d - close - 3 Sep 2014
avatar roland-d roland-d - close - 3 Sep 2014
avatar brianteeman
brianteeman - comment - 3 Sep 2014

I am a fan of this approach

On 3 September 2014 11:20, Thomas Hunziker notifications@github.com wrote:

A similar PR is open for the backend here: #3709
#3709

Personally I don't like using a custom.css and would rather use a
plugin/module to do the same. There are many already existing which do
exactly that and more.


Reply to this email directly or view it on GitHub
#4211 (comment).

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar Bakual
Bakual - comment - 3 Sep 2014

Reopening because the other PR is backend and this one is frontend. :smile:

avatar Bakual Bakual - change - 3 Sep 2014
Status Closed New
avatar Bakual Bakual - reopen - 3 Sep 2014
avatar Bakual Bakual - reopen - 3 Sep 2014
avatar phproberto
phproberto - comment - 3 Sep 2014

I think we should do the file_exists check with the full path:

JPATH_SITE . "/templates/protostar/css/custom.css"

avatar roland-d
roland-d - comment - 3 Sep 2014

In that case all references to $this->template should be removed. How about that?

avatar phproberto
phproberto - comment - 3 Sep 2014

Sorry I sent it from my smartphone. I mean:

file_exists(JPATH_SITE . '/templates/' . $this->template . '/css/custom.css')

Otherwise I think we can have problems with sites outside the root www.

avatar roland-d
roland-d - comment - 3 Sep 2014

I agree @phproberto Change has been comitted.

avatar phproberto
phproberto - comment - 3 Sep 2014

Tested. Seems to work ok before and after the last commit :dancer:

Good job Roland!

avatar brianteeman brianteeman - change - 4 Sep 2014
Status New Pending
avatar infograf768
infograf768 - comment - 10 Sep 2014

Not sure this would be B/C as some may have created a specific custom.css for TinyMCE only.

avatar Bakual
Bakual - comment - 10 Sep 2014

Not sure this would be B/C as some may have created a specific custom.css for TinyMCE only.

If I understand it correctly, the worst thing that could happen is that the custom.css file is loaded always, while it currently would be loaded only when an editor is loaded (like in a form).
I don't think that could break a template.

Also it would only be the case if someone uses the Protostar template.

avatar infograf768
infograf768 - comment - 10 Sep 2014

It could break the template easily as someone may need specific css just for Tiny, and this custom.css would override the template.css

avatar infograf768
infograf768 - comment - 10 Sep 2014

Example:
The template wants some clear text on dark background (plain or with image). The template.css has been changed to obtain this. But editing in Tiny is easier when text is black over clear background or no background at all...

avatar Bakual
Bakual - comment - 10 Sep 2014

But wouldn't that then break the template already currently when in a form with an editor? Or do you think they just don't care in that case but would if it spreads to the whole site?

Is that a generic TinyMCE feature that it loads the custom.css file if present?

avatar roland-d
roland-d - comment - 11 Sep 2014

You can't use Tiny specific tags in the custom.css?

avatar infograf768
infograf768 - comment - 11 Sep 2014

PLG_TINY_FIELD_CUSTOM_CSS_DESC="Optional CSS file that will override the standard editor.css file. Enter a file name to point to a file in the CSS folder of the default template (for example, templates/beez3/css/). Or enter a full URL path to the custom CSS file. If you enter a value in this field, this file will be used instead of the editor.css file."

It is common to call that file custom.css is what I mean.
The classes in such a file are usually the same as in template.css, but with differences in rendering:
as said above, can be the colours or else:
for example

<p><span class="badge">test</span></p>

default css

.badge {
    display: inline-block;
    padding: 2px 4px;
    font-size: 10.998px;
    font-weight: bold;
    line-height: 14px;
    color: #fff;
    vertical-align: baseline;
    white-space: nowrap;
    text-shadow: 0 -1px 0 rgba(0,0,0,0.25);
    background-color: #999;
}

if the template css has been changed to display "badge" black text on white background, the badge effect will not show in TinyMCE edit field. The custom.css will include a modified version (in that case the original css would fit)
I let you imagine sites where this has been done for dozains of css and site gets totally messed up because the custom.css is loaded in frontend

avatar Bakual
Bakual - comment - 11 Sep 2014

Thanks for the explanation. I now understand what you mean.

avatar brianteeman brianteeman - change - 22 Sep 2014
Category Templates (site)
avatar roland-d roland-d - close - 27 Sep 2014
avatar roland-d
roland-d - comment - 27 Sep 2014

Closing this as there seems to be no way around it nor any interest.

avatar roland-d roland-d - close - 27 Sep 2014
avatar roland-d roland-d - change - 27 Sep 2014
Status Pending Closed
Closed_Date 2014-09-03 10:21:38 2014-09-27 15:11:54
avatar mtmeyrick mtmeyrick - test_item - 17 Oct 2014 - Tested successfully
avatar roland-d roland-d - reopen - 20 Jan 2015
avatar roland-d
roland-d - comment - 20 Jan 2015

This topic came up again at the local user group. So I am thinking is, if custom.css can't be used, what if we change the name to something else for example user.css?

avatar roland-d roland-d - reopen - 20 Jan 2015
avatar roland-d roland-d - change - 20 Jan 2015
Status Closed New
avatar brianteeman
brianteeman - comment - 20 Jan 2015

Is the only problem the name custom.css?
If so then I would go with local.css or user.css
Seems easy enough

avatar roland-d
roland-d - comment - 20 Jan 2015

From what I understand what @infograf768 wrote it is indeed the name custom.css that is the problem here. Can you confirm @infograf768 ?

avatar brianteeman
brianteeman - comment - 20 Jan 2015

If thats the case then its an easy and useful addition

avatar dgt41
dgt41 - comment - 20 Jan 2015

@roland-d May I propose another way to solve this problem?
Here is my thought:
Introduce an empty less file e.g. isis/less/user.less
Edit template.less to include this new file at the end (same for the rtl)
Provide a button on the backend so admin can recreate the template.css, template-rtl.css

This way we will not introduce one more http request and users can always get some custom css served!

avatar brianteeman
brianteeman - comment - 20 Jan 2015

Thats not a good idea. Running the less compiler on a live " low resourced
shared" server is a guaranteed way to kill your account.

On 20 January 2015 at 22:12, Dimitris Grammatiko notifications@github.com
wrote:

@roland-d https://github.com/roland-d May I propose another way to
solve this problem?
Here is my thought:
Introduce an empty less file e.g. isis/less/user.less
Edit template.less to include this new file at the end (same for the rtl)
Provide a button on the backend so admin can recreate the template.css,
template-rtl.css

This way we will not introduce one more http request and users can always
get some custom css served!


Reply to this email directly or view it on GitHub
#4211 (comment).

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar dgt41
dgt41 - comment - 20 Jan 2015

@brianteeman The less compiler will be required to run only once, I didn’t mean "run less compiler for every request". But anyhow I haven’t benchmark this, so you might be right.

avatar brianteeman
brianteeman - comment - 20 Jan 2015

I understand you but users will make a change- compile make a change -
compile make a change - compile etct - trust me - seen it happen too often
on too many sites - it kills poor hosts

On 20 January 2015 at 22:25, Dimitris Grammatiko notifications@github.com
wrote:

@brianteeman https://github.com/brianteeman The less compiler will be
required to run only once, I didn’t mean "run less compiler for every
request". But anyhow I haven’t benchmark this, so you might be right.


Reply to this email directly or view it on GitHub
#4211 (comment).

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar Bakual
Bakual - comment - 21 Jan 2015

I still don't see what the problem is we're trying to solve. There are various extensions on JED which allow to do just that. And they are all better than what we would do here.

avatar infograf768
infograf768 - comment - 21 Jan 2015

From what I understand what @infograf768 wrote it is indeed the name custom.css that is the problem here. Can you confirm @infograf768 ?

yep.

There are various extensions on JED which allow to do just that. And they are all better than what we would do here.

There are indeed quite a few in
http://extensions.joomla.org/category/style-a-design/templating

avatar roland-d
roland-d - comment - 21 Jan 2015

I still don't see what the problem is we're trying to solve.

The problem is that users can't add their own CSS styling to Protostar without having to use a 3PD extension or hack the Protostar template. The majority of templates have such an option and it is almost standard to have a custom css file users can edit.

And they are all better than what we would do here.

I think we can offer the simplicity of custom css file, if users want more they can use an extension. Having to use an extension for a 4 line change seems overkill to me.

avatar brianteeman
brianteeman - comment - 21 Jan 2015

Agree. Were spending more time discussing it than it will take to
write,tear,document and comit
On 21 Jan 2015 09:09, "RolandD" notifications@github.com wrote:

I still don't see what the problem is we're trying to solve.

The problem is that users can't add their own CSS styling to Protostar
without having to use a 3PD extension or hack the Protostar template. The
majority of templates have such an option and it is almost standard to have
a custom css file users can edit.

And they are all better than what we would do here.

I think we can offer the simplicity of custom css file, if users want more
they can use an extension. Having to use an extension for a 4 line change
seems overkill to me.


Reply to this email directly or view it on GitHub
#4211 (comment).

avatar infograf768
infograf768 - comment - 21 Jan 2015

Anyhow, we would also need a rtl one I guess.
And the name anyway should be changed.

avatar roland-d
roland-d - comment - 21 Jan 2015

I will update the PR with the needed changes.

avatar infograf768
infograf768 - comment - 21 Jan 2015

Without adding a Parameter, this would be a hidden feature....

avatar mbabker
mbabker - comment - 21 Jan 2015

No, we don't. We just need to document it, IMO there is no need for a parameter to tell the template to scan for an optional custom CSS file.

avatar brianteeman
brianteeman - comment - 21 Jan 2015

A common thing done by many template clubs is to have a check for a custom
css file > 0k
If it is >0k then the file is included otherwise it isnt

So no need for any parameter. If it has content then it is used. If it has
no content then it is ignored

avatar roland-d
roland-d - comment - 23 Jan 2015

Ok, I have updated the name of the file and check if the size is larger than 0. Once this is merged I can write the documentation for it.

As for needing an RTL one, I think this is not needed as RTL specific changes can be put in this file as well because it is the last file loaded, so it will always be applied.

avatar brianteeman
brianteeman - comment - 4 Feb 2015

Are the travis errors on this PR related to the PR or the Unit Tests


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4211.

avatar roland-d
roland-d - comment - 4 Feb 2015

@brianteeman I don't see any errors on this PR?

avatar brianteeman
brianteeman - comment - 4 Feb 2015

Travis says it fails
On 4 Feb 2015 15:05, "RolandD" notifications@github.com wrote:

@brianteeman https://github.com/brianteeman I don't see any errors on
this PR?


Reply to this email directly or view it on GitHub
#4211 (comment).

avatar wilsonge
wilsonge - comment - 4 Feb 2015

Not the last commit from what i can see. I think you missed the most recent two

avatar brianteeman
brianteeman - comment - 4 Feb 2015

Ah I was going by the one at the top of this page on issues.joomla.org

On 4 February 2015 at 15:15, George Wilson notifications@github.com wrote:

Not the last commit from what i can see. I think you missed the most
recent two


Reply to this email directly or view it on GitHub
#4211 (comment).

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar roland-d
roland-d - comment - 4 Feb 2015

@brianteeman I wonder if that is a bug of JIssues not updating the status.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4211.

avatar brianteeman
brianteeman - comment - 4 Feb 2015

Yeah I've raised that as a bug

avatar brianteeman
brianteeman - comment - 4 Feb 2015

@test
Created a user.css using the template manager
Tested it is loaded after template.css
Tested it is not loaded if empty

All good


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4211.

avatar brianteeman brianteeman - test_item - 4 Feb 2015 - Tested successfully
avatar thebeuving
thebeuving - comment - 4 Feb 2015

@test
Created a user.css in the templates/protostar/css directory
loads after template.css
does not load if empty

avatar zero-24 zero-24 - change - 4 Feb 2015
Status New Ready to Commit
avatar zero-24
zero-24 - comment - 4 Feb 2015

Moving RTC thanks for testing. Can someone add the New Feature and RTC label?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4211.

avatar brianteeman
brianteeman - comment - 4 Feb 2015

Setting RTc - thanks


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4211.

avatar brianteeman brianteeman - change - 4 Feb 2015
Labels Added: ?
avatar brianteeman brianteeman - change - 4 Feb 2015
Labels Added: ?
avatar wilsonge wilsonge - change - 4 Feb 2015
Milestone Added:
avatar ghazal
ghazal - comment - 28 Jun 2015

Why restrain this new feature to 3.5 ?
Tested in last 3.4.2RC, and it works allright. no big deal either.
As it is said earlier, now, it's common practice among frameworked templates to allow the ability to add a custom.css file to the template.
And, as Brian Teeman says, "So no need for any parameter. If it has content then it is used. If it has no content then it is ignored".
Furthermore, why add a third party extension to perform such a trivial action, very useful though.
To make it short, I think It would be a very nice addition to J!3.4.2

avatar Bakual
Bakual - comment - 28 Jun 2015

Why restrain this new feature to 3.5 ?

Because according to SemVer, new features require a new minor version. So it will be 3.5. No big deal either :smile:

avatar roland-d roland-d - reference | 1f16717 - 11 Jul 15
avatar mbabker mbabker - close - 11 Jul 2015
avatar mbabker
mbabker - comment - 11 Jul 2015

Merged to 3.5-dev via 1f16717

avatar mbabker mbabker - change - 11 Jul 2015
Status Ready to Commit Closed
Closed_Date 2014-09-27 15:11:54 2015-07-11 13:44:38
Closed_By mbabker
avatar mbabker mbabker - close - 11 Jul 2015
avatar roland-d roland-d - reference | bdfbb9f - 6 Aug 15
avatar roland-d roland-d - reference | 1268751 - 24 Oct 15
avatar haya1300
haya1300 - comment - 9 Nov 2015

I prefer custom.css instead of user.css because in all documentation on the internet or in pdf docs there it is called custom.css. If you want to have properly documentation you must add this exception for the Protostar template in the documentation.
Also plenty Joomla users who are using the custom.css of the Protostar template on their website(s) it will not functioning any more and it must be adjusted after an upgrade to Joomla 3.5
Off course it can be fixed easily but that is not user-friendly.
This is the reason why I should prefer to call it custom.css

avatar zero-24
zero-24 - comment - 9 Nov 2015

@haya1300

Also plenty Joomla users who are using the custom.css of the Protostar template on their website(s) it will not functioning any more and it must be adjusted after an upgrade to Joomla 3.5

No. If it works bevor the update it will work also after the update. (e.g. via Plugin) If you use a core hack to make this work without a template copy this gets reverted every update anyway ;)

avatar roland-d
roland-d - comment - 10 Nov 2015

@haya1300 It is not possible to use the name custom.css because Tinymce will otherwise use the file and apply the CSS style to your editor window.

If you want to have properly documentation you must add this exception for the Protostar template in the documentation.

It doesn't have to be us. Joomla is a community, so you can do it as well.

avatar jjsjjs
jjsjjs - comment - 13 Feb 2016

Am i correct that i only have to use/change the index.php to be able to use custom.css ?
Can i use it already in 3.4.8?
If so this is a great feature as i believe Protostar is one of the finest templates around.

avatar wilsonge
wilsonge - comment - 13 Feb 2016

No it's going to be in Joomla 3.5 (you can look at the milestone on the right to see what version it will be in) - and it will not require any changes to index.php when it's introduced - you will just need to create your custom CSS file.

avatar jjsjjs
jjsjjs - comment - 13 Feb 2016

ok great!
Thanks

avatar N6REJ
N6REJ - comment - 14 Feb 2016

You can use a custom.css with any template easily if you install my plugin
http://extensions.joomla.org/extension/jowwow-css-loader

On 2/13/2016 05:27, jjsjjs wrote:

Am i correct that i only have to use/change the index.php to be able
to use custom.css ?
Can i use it already in 3.4.8?
If so this is a great feature as i believe Protostar is one of the
finest templates around.


Reply to this email directly or view it on GitHub
#4211 (comment).

avatar jjsjjs
jjsjjs - comment - 16 Feb 2016

Thanks a lot :)
I going to check it out right now.

If works ok i will write a review on the extensions page. This would be also a good candidate as a standard item for Joomla ;)
Please update the link to your plugin on the extensions.joomla.org page, thanks. it's a 404

avatar N6REJ
N6REJ - comment - 21 Feb 2016

@jjsjjs let me go do that really fast.. idky its not correct.

avatar thebeuving
thebeuving - comment - 21 Feb 2016

I am out of the office February 18th and 19th. If this is an emergency please call me at (209) 217-6400 and leave a voicemail if I don't answer, I will do my best to respond promptly.

I will reply to all non-emergency requests on Monday February 22st.

Thank you,
David Beuving

avatar N6REJ
N6REJ - comment - 21 Feb 2016

@jjsjjs updated

avatar jjsjjs
jjsjjs - comment - 21 Feb 2016

Thanks Bear! Great plug-in. Worked instantly, no hasle. I will write a review this week on the extensions page under the pseudoname idnib (haha it's the reverse of my daughter's name)

avatar N6REJ
N6REJ - comment - 22 Feb 2016

Thanks... its been a long time since I updated it but it does everything
I can reasonably want it to do and now with the ability to add css file
right from within the template manager I dont' see the urgent need to
change it.
Bear

On 2/21/2016 15:58, jjsjjs wrote:

Thanks Bear! Great plug-in. Worked instantly, no hasle. I will write a
review this week on the extensions page under the pseudoname idnib
(haha it's the reverse of my daughter's name)


Reply to this email directly or view it on GitHub
#4211 (comment).

avatar wilsonge
wilsonge - comment - 22 Feb 2016

Guys this isn't the place to be talking about 3rd party plugins ;) Please take it off this thread :)

avatar N6REJ
N6REJ - comment - 23 Feb 2016

just close the ticket george

On 2/22/2016 14:41, George Wilson wrote:

Guys this isn't the place to be talking about 3rd party plugins ;)
Please take it off this thread :)


Reply to this email directly or view it on GitHub
#4211 (comment).

avatar wilsonge
wilsonge - comment - 23 Feb 2016

It's been closed since August ;)

avatar wilsonge wilsonge - locked - 23 Feb 16

Add a Comment

Login with GitHub to post a comment