View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0012352 | mantisbt | html | public | 2010-09-15 08:12 | 2019-12-23 15:15 |
| Reporter | rakekniven | Assigned To | |||
| Priority | normal | Severity | feature | Reproducibility | always |
| Status | acknowledged | Resolution | open | ||
| Summary | 0012352: Add my own css code without modifying default.css | ||||
| Description | There is css/default.css which is delivered with Mantis. First thought was "Cool, I can use default.css and use $g_css_include_file to append my css code from separate file". But behaviour is different because when I use $g_css_include_file then only this file is used and default.css is ignored. So please add the posibility to add own css code without touching default.css. Every time I update Mantis I have to diff old and new default.css to merge my changes into new default.css. | ||||
| Additional Information | This issue results from a post to forum: | ||||
| Tags | redesign | ||||
| Attached Files | issue12352.patch (2,365 bytes)
From ad178b396d577a489ebe80aa496b96c2155336ec Mon Sep 17 00:00:00 2001
From: Kirill Krasnov <krasnovforum@gmail.com>
Date: Mon, 20 Sep 2010 16:35:56 +0300
Subject: [PATCH] Fix 12352: change config-value css_include_file for user define file
which can overwrite values from default file default.css
---
config_defaults_inc.php | 4 ++--
core/html_api.php | 3 ++-
docbook/Admin_Guide/en-US/Configuration.xml | 3 ++-
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/config_defaults_inc.php b/config_defaults_inc.php
index ca109c3..395d219 100644
--- a/config_defaults_inc.php
+++ b/config_defaults_inc.php
@@ -3101,10 +3101,10 @@ $g_bottom_include_page = '%absolute_path%';
$g_top_include_page = '%absolute_path%';
/**
- * CSS file
+ * CSS file for user overwrite
* @global string $g_css_include_file
*/
-$g_css_include_file = 'default.css';
+$g_css_include_file = '';
/**
* RTL CSS file
diff --git a/core/html_api.php b/core/html_api.php
index 7784df0..6e6c7e8 100644
--- a/core/html_api.php
+++ b/core/html_api.php
@@ -353,7 +353,7 @@ function require_css( $p_stylesheet_path ) {
*/
function html_css() {
global $g_stylesheets_included;
- html_css_link( config_get( 'css_include_file' ) );
+ html_css_link('default.css');
html_css_link( 'jquery-ui.css' );
# Add right-to-left css if needed
if ( lang_get( 'directionality' ) == 'rtl' ) {
@@ -362,6 +362,7 @@ function html_css() {
foreach ( $g_stylesheets_included as $t_stylesheet_path ) {
html_css_link ( $t_stylesheet_path );
}
+ html_css_link( config_get( 'css_include_file' ) );
}
/**
diff --git a/docbook/Admin_Guide/en-US/Configuration.xml b/docbook/Admin_Guide/en-US/Configuration.xml
index 84d2eec..900f1d5 100644
--- a/docbook/Admin_Guide/en-US/Configuration.xml
+++ b/docbook/Admin_Guide/en-US/Configuration.xml
@@ -1628,7 +1628,8 @@
<varlistentry>
<term>$g_css_include_file</term>
<listitem>
- <para>Set this to point to the CSS file of your choice.</para>
+ <para>Set this to point to the user CSS file of your choice which
+ can overwrite default values in default.css.</para>
</listitem>
</varlistentry>
<varlistentry>
--
1.7.2.3.msysgit.0
| ||||
|
As a temporary workaround you can just place @import url('default.css') to the top of your custom CSS file. |
|
|
Thanx dhx for this valuable hint. Now I can use default.css AND my custom css. You can close this issue if you want. |
|
|
Thanks for the feedback. I'll probably leave this issue open as there is a valid feature request here for a configuration option that is essentially an array of additional CSS files to include. Using @import is usually frowned upon due to performance reasons (browsers have to wait for custom.css to load before it can start loading default.css - ideally both files should be downloaded in parallel by the browser). |
|
|
Hello dhx, your arguments sounds very comprehensible. It would be a much better solution to have configuration options for that. Personally I can live with @import in our intranet. No performance problems ;-) |
|
|
@rakekniven, please try test issue12352.patch attached to this issue and write result in comments. |
|
|
Hello Kirill, we run stable 1.2.3 here. Could you provide a patch against 1.2.3? Thanx |
|
|
You can close issue. |
|
|
The provided patch is actually against master branch (1.3.x) |
|
|
Dropping target version - reporter states we can close issue - i'm inclined to leave it open for now (sorry rake for any email notifications on this) just so we can implement something when dealing with theming/redesign. It's already got the redesign tag so we should pick it up then. |
|
|
Currently, any custom CSS or JS file can be included with a plugin that uses the EVENT_LAYOUT_RESOURCES. |
|