I have a problem with the Omega Theme's styling. I'm actually trying to do something very basic: To make the paragraph margin smaller. Normally I'd put stuff like that into sites/all/themes/my_omega_subtheme/css/global.css and it would work, but in this case it didn't.
So I debugged the webpage and it seems Omega puts some temporary CSS files into sites/default/files/css that are overriding global.css. So I guessed I would be able to change this in the appearance settings, but there aren't any settings for the paragraph margin. Of course I can't change the margin in there, either, because the files seem to be generated every now and then (at least the names are different today, and I made sure to not click save in the appearance settings).
Additionally I tried setting it with CSS ID and / or class because I thought this would surely override the temporary CSS file's value of p { margin-bottom: 20px; }, but it seems I'm just not informed properly.
So what is the correct way to set the paragraph margin in an Omega theme?
Normally the CSS files stored in sites/default/files/css are the compressed CSS files which drupal generates automatically. To be able to make any changes appear as normal, you need to disable CSS compression.
Go to ?q=admin/config/development/performance and un-check the option Aggregate and compress CSS files.
Now when you view the page source, you should be able to see a list off your theme's CSS files.
Related
I am trying to implement a finite number of colors (like square icons) on the Draftail editor itself. What will be the best way to approach this?
It should be similar to how Microsoft Word displays the font color or something along those lines.
Thanks in advance.
I'm not sure if it's the best approach but here is what I came up with:
https://gist.github.com/benoitvogel/46022124d46de03ed2078603fb24ca97
This defines a new inline style which encloses the selected text between <span class="mycustomclass"></span> (change feature_name according to the CSS class you want to use).
Then, you just have to define the corresponding .mycustomstyle CSS class in your frontend as usual:
.mycustomstyle {
color: purple;
}
You can also modify control['style'] to change the way this style will be displayed in the editor.
You will get 1 icon/label per CSS class, so it's not really like in Word as you won't get a proper selector. I haven't tried it myself, but according to Wagtail docs icon can reference SVG, so you might be able to display color squares instead of labels.
Hope it fits your needs.
Currently, I am using a directive from a third-party library for a UI toggle button. I changed the background color and left/right positions of the toggle button a bit to meet my business specifications. E.g. the out-of-the-box style came as light green for true, light red for false; I changed this to a darker green for true, and a light grey for false. I also moved the toggle positionally a bit to the left. All of this works fine.
The one issue I'm experiencing is that for a split millisecond when the page with the toggle button renders, I see the old style quickly change from what came out-of-the-box, to my updated style. There aren't any other glitches in style after this fact, just the initial loading shows some quick shifting around on the element. This isn't a huge issue but I can't seem to pinpoint the issue or know why it is happening. Any thoughts? Something in an issue for CSS hierarchy perhaps?
Notes relevant to the issue:
I used the inspector to find the classes I needed to override, since the directive itself just uses an nz-toggle tag.
I am using !important to override. I've read that this is bad practice in itself but it is being used across the entire project and has been established as "our standard" of overriding styles
Here's an example of one rule from my CSS file compared to what comes out of the box:
.nz-toggle-wrap.true {
background-color: #089900 !important;
right: -16px !important;
width: 50px !important;
height: 28px !important;
}
vs.
.nz-toggle-wrap.true {background-color: #60bd68;}
Any thoughts?
This happens because your "new" CSS loads after the "old" CSS.
Of course that should be true anyway, because you want to override the old style, but it seems that the old and new code are too far away from each other hence you manage to see it change.
To solve this you have to move the new style "closer" to the old style.
The way to do it depends on your project architecture and your build process.
Another option is that the class "true" is added only after page load, and so only then your new style kicks in.
If you are loading this "third party library" locally, you might have to directly edit the CSS files of the plug-in.
With the plug-in you linked, maybe you need to edit this file directly to prevent the "flicker", which is caused by the styles loading in sequence:
https://github.com/tannerlinsley/nz-toggle/blob/master/src/nz-toggle.styl
I have a particular rounded button, with his CSS, but when I use it, my CSS blow up, because there are Ionic CSS "standard" rules.
My .button class is ruinded by the .button CSS class of Ionic.
I already tried to change name to my .button class but nothing. The only way to get my button is to not import the Ionic.css file, but of course, I need it for the other elements,
My button is nested inside other elements, for which I need the Ionic CSS
So, I need to know if is possible to exclude a specific HTML tag from the Ionic CSS rules, without edit Ionic.css file
Not possible. Go into the Ionic.css and Edit it. You can edit it. I checked the Docu for Sass: http://ionicframework.com/docs/cli/sass.html The CSS is placed in this folder: www/lib/ionic/css The better solution is, to set up an Sass environment. Then you can use only the components you need.
And other solution, but a bit dirty, is, to override the rule with a deeper selector. Maybe with .container .button or div.button or button.button or body .button.
You can use other class name in your custom css and use the property !important in each of your css rules. Anyway you could change the order of the imports.
I'm trying to set opacity for extjs (4.2.1) panel (whose id is myPanel) as Ext.get('myPanel').el.setOpacity(0.65). It works fine in firefox and chrome but not in IE 8. The ultimate goal is to make the panel transparent so that the user can see through it. Could any one please help me with this...
Ext will simply apply the CSS property "opacity" or alpha transparency to an HTML element. In IE8 this is almost in no case supported.
You could however use a plugin or hack to make IE 8 compatible with it.
Check http://css3pie.com/ or http://modernizr.com/ for example.
Also check http://www.electrictoolbox.com/opacity-internet-explorer-css3-pie-alpha-transparency/ for an example of your issue, and how it is solved using PIE
When you dont want to use 3rd party plugins, you can also try this:
Add the following rules to the CSS of your property
/* IE8 */-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
/* IE 5-7 */ filter: alpha(opacity=50);
You can also do this with Ext.js using Ext.get('myPanel').el.setStyle()
e.g.
Ext.get('myPanel').el.setStyle('-ms-filter','progid:DXImageTransform.Microsoft.Alpha(Opacity=50)');
Finally..after breaking my head for as while..I came up with 2 solutions...
1) Apply x-panel-ghost (which is an extjs in build css applied during the drag process) for baseCls or componentCls gave the transparency. But all the other default css for a extjs panel are lost and so we have to manually write them up..
2) The best solution would be to set an image which is made transparent (through photoshop or something) as a background image for the panel header and body and apply it to the cls config of the panel as below:
In panel:
cls: 'transparency',
In css file:
.transparency .x-panel-header{
background: transparent url('../image.png') no-repeat center !important;
}
And in the same way, for the body as well..
Hope this helps someone...
How can i Enable the Text Color plugin of Tinymce in Toolbar of Visual Editor ?
I was able to enable the print, search and replace plugins inside the Visual Editor by editing this file
Composite/content/misc/editors/visualeditor/includes/toolbarsimple.inc
and
modifying a line in below file to include the searchreplace, print plugins
Composite/content/misc/editors/visualeditor/visualeditor.js
plugins: "compositelink,compositetable,compositeimage,compositerendering,compositecharmap,compositefield,compositetext,paste,lists,searchreplace,print",
Similarly is there any way to enable the inbuild feature of Tinymce namely Text Color, Font Size, Font Family, Table, Row, Column in the toolbar of the Visual Editor without making the changes through styles which is done by editing this file
Frontend/Config/VisualEditor/common.xml
Thanks
Ajith
Managed to get the Text Color, Background Color, Font Family, Font Size up and running inside the Composite C1 editor.
Listing down the steps below for the benefit of others.
Copy all the files and folder from Website\Composite\content\misc\editors\visualeditor\tiny_mce\themes\advanced except editor_template.js and editor_template_src.js into your Website\Composite\content\misc\editors\visualeditor\tiny_mce\themes\composite folder.
Edit the file Website\Composite\content\misc\editors\visualeditor\visualeditor.js and include the below lines in the config section.
skin: 'default',
theme_advanced_buttons1: "forecolor,backcolor,fontselect,fontsizeselect",
theme_advanced_buttons2: "",
For a complete list of options visit the TinyMCE link and go to View Source.
You might also want to inclue inlinepopups in the plugins: line for proper rendering of the popups. Any additional plugins like insertdatetime, media, print,searchreplace, etc can also be included in the same line.
To include the plugins like insertdatetime, media, print, searchreplace in existing toolbar row, edit the Website\Composite\content\misc\editors\visualeditor\includes\toolbarsimple.inc file and include the respective tags containing the commands. For eg.
<ui:toolbargroup>
<ui:toolbarbutton cmd="mceSearch" tooltip="Search" image="${skin}/wysiwygeditor/search.png" isdisabled="false" />
<ui:toolbarbutton cmd="mceReplace" tooltip="Replace" image="${skin}/wysiwygeditor/replace.png" isdisabled="false" />
</ui:toolbargroup>
Copy and merge the code from the Website\Composite\content\misc\editors\visualeditor\tiny_mce\themes\advanced\editor_template_src.js file into the Website\Composite\content\misc\editors\visualeditor\tiny_mce\themes\composite\editor_template.js file. Most of the functions can be copied over as it is. Only the common ones like renderUI need special attention. I directly gave a call to the simpleLayout function instead of using a switch in the renderUI
ic = t._simpleLayout(s, tb, o, p);
There could be some issue with not being able to see the entire content in the editor for large content, to fix this issue edit the Website\Composite\content\misc\editors\visualeditor\tiny_mce\themes\composite\skins\default\ui.css file and modify the .defaultSkin iframe css to specify proper height or overflow scroll.
To include more features to your toolbar, just edit theme_advanced_buttons1.
Good Luck..
Ajith
With Composite C1 you need to do styling (like font face, font size, colors and table related styles) using CSS classes and make these classes available to end-users.
The front-end developer define classes needed in CSS and then register them in the toolbar configuration file from where the end-user can select the styles. Composite C1 does not promote having font tags or style attributes in the content html, so if that is what you really want you need to make changes to the core javascript.
You can read about customizing the Visual Editor toolbar here http://docs.composite.net/Console/CustomizingVisualEditor.