My Joomla article uses Jumi to include a php file.
The php file uses $document->addStyleDeclaration It all seems to work, except that the added style is commented out by the method! The new style is surrounded by HTML comments.
Joomla 1.5.21. Suggestions appreciated!
php file:
<?php
defined('_JEXEC') or die( "Direct Access Is Not Allowed" );
$style = <<<FOOBAR
#import url("http://foo.css");
.gfg-entry {height: 6.9em;}
#feed-control {width : 500px; padding : 10px;}
FOOBAR;
$document =& JFactory::getDocument();
$document->addStyleDeclaration ($style);
?>
Below, what is getting added to the page's Head section.
Note the added <!-- and --> comments bracketing:
<style type="text/css">
<!--
#import url("http://foo.css");
.gfg-entry {height: 6.9em;}
#feed-control {width : 500px; padding : 10px;}
-->
</style>
Oops, it's a feature, not a bug. Joomla inserts the <!-- and --> to make the resulting page pristine XHTML.
The browser ignores HTML-style comments within style tags. Style tags use /* for comments */
Related
Following the MDN documentation here: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/options_ui
I have setup the following manifest.json:
{
...
"options_ui": {
"page": "options.html",
"browser_style": true
}
...
}
Along with an options.html which contains this HTML:
<div class="switch">
<input checked id="switch1" type="checkbox" class="visually-hidden">
<label for="switch1"></label>
</div>
I expected my HTML to be decorated with styles similar to the Firefox style guide: http://design.firefox.com/StyleGuide/#/userselections
But there are none. No extra CSS file appears to be loaded.
There is a similar question here but the question is asking for documentation for styles. All I have found is that the styles simply aren't applied.
Does anyone know if I have this setup correctly? I can't tell if it's a bug.
Styles are correctly applied, you are probably just using the wrong classes.
Note that the old style guide is now deprecated in favor of the new Photon Design System.
These are the used stylesheets, just go to these URLs in Firefox to see the full source:
On Windows: chrome://browser/content/extension.css
On Mac: chrome://browser/content/extension-mac.css
Most of the styles assume you use the browser-style class. For example, here are some of the styles for the button element (on Windows):
/* stylelint-disable property-no-vendor-prefix */
/* Buttons */
button.browser-style,
select.browser-style {
background-color: #fbfbfb;
border: 1px solid #b1b1b1;
box-shadow: 0 0 0 0 transparent;
font: caption;
height: 24px;
outline: 0 !important;
padding: 0 8px 0;
transition-duration: 250ms;
transition-property: box-shadow, border;
}
Let's verify if the styles are actually applied.
Example, given an extension with the following manifest.json:
{
"name": "Options page",
"manifest_version": 2,
"version": "0.0.1",
"description": "Sample options page",
"options_ui": {
"page": "options.html",
"browser_style": true
}
}
And the following options.html:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<div>Just a text example page</div>
<div>
<input checked id="switch1" type="checkbox" class="visually-hidden">
<label for="switch1"></label>
<button class="browser-style">Test button</button>
</div>
</body>
</html>
This is the rendered options page:
Inspect the options page to verify the applied styles:
Paste about:debugging into the address bar
Select "Enable add-on debugging" on top
Click on the Debug link
Click "Ok" when prompted for allowing incoming connection
Now switch back to the Options page and inspect the "Test button" we added
As you can see, the button is correctly styled with the browser stylesheet.
Is it possible to set a margin around fields.
For example in image :
If I want to set lower (separated) checkBox in line with above once, is there a way to do it?
Marko
Start by inspecting the HTML code (with Chrome).
The code corresponding to the Checkbox Field is something like that:
<div class="form-field check-box-field"
data-modelclass="org.eclipse.scout.widgets.client.ui.forms.CheckboxFieldForm$MainBox$ConfigurationBox$CheckboxField"
data-classid="CheckboxField_org.eclipse.scout.widgets.client.ui.forms.CheckboxFieldForm"
id="scout.CheckBoxField[1-49]"
style="left: 0px; top: 14px; width: 1598px; height: 30px;"
>
<div class="field has-inner-alignment halign-left valign-top" style=
"left: 148px; top: 0px; width: 1420px; height: 30px;">
<div class="check-box" tabindex="0"></div>
<div class="label">
Checkbox
</div>
</div>
</div>
With CSS you can do anything possible:
.check-box-field {
background-color: red;
}
Now because you do not want to add some custom CSS style for all CheckBox Fields, you can define a custom Css-Class in your CheckBox:
#Order(4)
public class UnknownCheckBox extends AbstractBooleanField {
#Override
protected String getConfiguredCssClass() {
return "checkbox-under-listbox";
}
// ... Some Code ...
}
And now you add this CSS code:
.checkbox-under-listbox {
margin-left: 20px;
}
I have realized this example with the Widgets Demo Application (org.eclipse.scout.docs repository, releases/5.2.x branch). I added my css code in this file: org.eclipse.scout.widgets.ui.html/src/main/js/widgets/main.css (It is probably not the best approach to have everything in main.css).
You can deduce from this example how you can add an additional CSS/LESS module and macro to your application. This post: Inclusion of additional icons from font-awesome might also be usefull. You will have a main.css instead of a font.css.
WARNING: this is not state of the art.
At the end this is normal HTML development (single page application of course), so you can do what you want...
If you do not want to use the LESS compiler and the File preprocessor, you can simpelly add a normal CSS file in the folder:
<your_project>.ui.html/src/main/resources/WebContent
Let say:
<your_project>.ui.html/src/main/resources/WebContent/my_custom.css
Do not forget to include your CSS File between the <head> and </head> tags in the HTML index file:
<your_project>.ui.html/src/main/resources/WebContent/index.html
Something like:
<head>
<!-- some code -->
<link rel="stylesheet" type="text/css" href="my_custom.css">
<scout:stylesheet src="res/scout-module.css" />
<!-- some code -->
</head>
You can always use custom CSS: Let your field implement IStyleable and use setCssClass() to apply an appropriate CSS class. I'd try to avoid using such pixel pushing approaches as much as possible.
my IE8 doesn't show images inner the figure tag.
TYPO3 Installation 6.1.x
DOCTYPE HTML5
css styled content (latest)
Frontend: Text & Image will shown as
<div class="csc-textpic-imagewrap">
<div class="csc-textpic-center-outer">
<div class="csc-textpic-center-inner">
<figure class="csc-textpic-image csc-textpic-last">
<img height="308" width="828" alt="" src="fileadmin/media/image.JPG">
</figure>
</div>
</div>
</div>
I 've included HTML5shiv Script - nothing happens .. then I tries to unwrap the figure element with jQuery - nothing happens
Has anyone an idea how I can show my image wrapped with
it was a responsive big
img {
max-width: auto;
width: 100%;
/* and for IE 8 */
width: auto\9;
}
That's it Damn.!
I had the same problem:
tt_content.image.20.rendering.singleNoCaption.singleStdWrap.wrap.override >
tt_content.image.20.rendering.noCaption.singleStdWrap.wrap.override >
Or instead of deleting it, replace it with whatever html you like.
just set this in config typoscript
doctype = html5
I want to put "5px padding" for my banner in a module. I have made a template with artisteer. Simply I have added a module calling "top" in my index.php file like this:
<div class="logo_custom">
<jdoc:include type="modules" name="logo" />
</div>
It appears the banner with "padding:0 0;". How can I put a 5px padding for my banner? I have tried with div, calling a class with css file. But doesn't work. If anyone has any idea please share it with me.
Thanks in advance. Sorry for my poor English.
.logo_custom { padding: 5px; }
I am currently working with a page that has a few hidden divs, being called on to be displayed later.
This is the code I have on the page itself causing the problem.
<div align="center" id="check">
Block of plain text right here.<br />
Checking...<br />
<img src="http://sw6.us/template/images/loading.gif" /><br />
<?php
require("databasetest.php");
?>
echo "check_data shown";
</div>
This code here is what I have modifying the "check" div on a style page
.check {
padding-top: 25px;
padding-left: 0px;
color: white;
align: center;
display:none;
}
As you can see the div is instructed to be hidden on page load via the style code. Everything is hidden except for the picture.
I don't believe the PHP is the issue because I included an echo displaying text which is properly hidden along with the HTML before it. I also took out that require command and the image was still not hidden. The image being a .GIF is not the issue either, I have tried using a .png and got the same problem!
Thanks for the help! It is greatly appreciated!