CSSStyleDeclaration / Runtime CSS
Context:
My framework loads CSS at runtime using SWF modules.
Once my CSS module is loaded, I update the styles of my
application
using the mx StyleManager.
My problem is the following:
CSSStyleDeclaration.setStyle(styleProp:String, newValue:*)
does not offer
a way to delay the style update.
The consequence is a lack of performance, because setStyle
updates the whole
display list each time it is called.
Fortunately I found a workaround in my context (setStyle
overloaded...)
Note that
StyleManager.clearStyleDeclaration(selector:String,
update:Boolean) offers
a way to delay the update.
Is there any reason
CSSStyleDeclaration.setStyle(styleProp:String, newValue:*)
does not include an
update parameter too ?
Thanks.
Thierry
Hi,
Great, simple example. I'm working on something similar; an
application that loads runtime css.swf. When the loader and css.swf
are online it works fine, and when the loader and the css.swf are
offline it works fine. However when the loader is offline and the
css.swf is online I get the following error. This situation is
desired as it contracts me to use the 'live' styles while I do
updates on my loader from my desktop. I can recopy my online
css.swf to the offline as a workaround, but that is less desirable.
I want to fix the issue so that the loader can be offline and the
css.swf can be online. Typically in flash this type of operation
(for everything except this css.swf workflow) works fine in my
experience. As far as I can tell its because the css.swf does not
'allow' itself, security-wise to be loaded. The css.swf has no as3
scope of course (because its based in a *.css file) so I can't use
Security.allowDomain('*'). Likewise it doesn't call a crossdomain
automatically either.
ERROR:
Error: Unable to load style(SWF is not a loadable module):
http://images50.neopets.com/style_set_manager/styles_EN_v1.swf.
QUESTION:
Anyone know how to get this to work? I'll check back to this
blog daily, and post the solution here if I find it
elsewhere.
Similar Messages
-
hi,
there are a lot of blog posts and excellent documentation on using runtime css.
however, none of them really address the *why*.
the adobe docs say:
"By loading style sheets at run time, you can load images (for graphical skins), fonts, type and class selectors, and programmatic skins into your Flex application without embedding them at compile time. This lets skins and fonts be partitioned into separate SWF files, away from the main application. As a result, the application's SWF file size is smaller, which reduces the initial download time. However, the first time a run-time style sheet is used, it takes longer for the styles and skins to be applied than if you load styles by using the <mx:Style>
tag. This is because Flex must download the necessary CSS-based SWF file while the application is starting up or running."
from what i gather:
- it's good because i've separated my styling code from my application code. ok, fine. not critical tho.
- reduces initial download time? fine. but I still can't display my app because I have to wait for the css swf to be download first and then be applied (which takes longer to apply at runtime)
- takes more code to apply the style, when to apply it in the initialization phase, and how to avoid flicker of original halo style
- i've seen a few posts on problems with css and modules
do i need to swap css styles at runtime? no.
but lets assume i want to change the style in the future to give it a fresh look. i could simply replace the css swf on the server and only that swf will be downloaded and updated in the users browser cache. correct? great. for all that architectural pain, i've saved them a few extra kilobytes of download time.
and what about themes? the halo theme is the default and compiled into your app *regardless* of whether u use runtime css or compile time css. so u may as well build a theme swc to begin with.Some folks have apps that swap themes/skins at runtime sort of like Windows Media Player.
Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs.adobe.com/aharui -
Difference with embedded CSS vs loading runtime CSS
Hi,
Move from embedded CSS to runtime CSS, but having some subtle differences.
note the numeric stepper handles have default colors, this is with embedded css and what the client wants
This one is runtime css note the handles are black.
I had this in both before embedded and runtime CSS
NumericStepper {
fillAlphas: 0.6, 0.4, 0.75, 0.65;
fillColors: #ffffff, #cccccc, #ffffff, #eeeeee;
themeColor: #92de78;
I added this to the runtime css and entered the style name for the numeric stepper but still no luck
.numericStepper {
fillAlphas: 0.6, 0.4, 0.75, 0.65;
fillColors: #ffffff, #cccccc, #ffffff, #eeeeee;
themeColor: #92de78;
Any ideas complete css below. BTW my alerts are not using the runtime css as well yet embedded css works fine
@font-face {
src:url("auth_module/poetica.swf");
font-family: "Poetica Std";
Application {
backgroundImage: Embed(source="/images/bkg.gif");
backgroundSize: "100%";
NumericStepper {
fillAlphas: 0.6, 0.4, 0.75, 0.65;
fillColors: #ffffff, #cccccc, #ffffff, #eeeeee;
themeColor: #92de78;
.numericStepper {
fillAlphas: 0.6, 0.4, 0.75, 0.65;
fillColors: #ffffff, #cccccc, #ffffff, #eeeeee;
themeColor: #92de78;
Alert{
color : #000000;
title-style-name : "alertTitle";
button-style-name :"alertButtonStyle";
header-height:21;
border-thickness: 1;
drop-shadow-enabled: true;
drop-shadow-color :#CCCCCC;
shadowDirection:right;
shadowDistance:7;
background-color: #ffffff;
corner-radius :6;
border-style :solid;
header-colors : #DDDDDD, #ffffff;
footer-colors : #DDDDDD, #ffffff;
border-color : #333333;
.alertButtonStyle {
color : #000000;
.alertTitle{
font-family :Verdana;
font-size :10;
font-weight :bold;
text-align :left;
color :#000000;
.selectedBox {
headerColors:#336633,#447744;
borderColor:#447744;
titleStyleName: "selectedHeaders";
.legendBox {
border-thickness: 2;
border-style:solid;
border-color: #93C789;
.legendMask {
stroke-color: #333333;
stroke-width:2;
shadow-color: #333333;
.legendTitle {
font-size :12;
font-weight :bold;
.accordionHeaders {
font-family: "Poetica Std";
font-size:14pt;
color:#FFCC00;
.copyrighttext {
font-family: "Poetica Std";
font-size:14pt;
TextInput {
color: #0b333c;
List {
color: #0b333c;
CheckBox {
themeColor: #92DE78;
fillColors: #ffffff, #cccccc, #ffffff, #eeeeee;
color: #0b333c;
.piecharBackground {
backgroundImage: Embed(source="/images/bkg.gif");
backgroundSize: "100%";
color: #93C789;
DataGrid {
color: #0b333c;
rollOverColor: #92de78;
selectionColor: #93C789;
textRollOverColor: #cc3333;
headerColors: #000000, #333333;
headerStyleName: "mydataGridHeaderStyle";
.mydataGridHeaderStyle {
color: #92de78;
ApplicationControlBar {
highlightAlphas: 0.4, 0;
fillAlphas: 1, 1;
cornerRadius: 0;
fillColors: #000000, #333333;
backgroundColor: #000000;
color: #93C789;
CheckBox {
color: #93C789;
Accordion {
fillAlphas: 1, 1, 1, 1;
fillColors: #000000, #333333, #000000, #333333;
selectedFillColors: #000000, #333333;
themeColor: #92de78;
textRollOverColor: #cc3333;
headerStyleName: "myaccordionHeader";
borderColor: #93C789;
backgroundImage: Embed(source="/images/bkg.gif");
backgroundSize: "100%";
color: #92de78;
.myaccordionHeader {
color: #92de78;
TabNavigator {
tabStyleName: "myTabs";
selectedTabTextStyleName: "mySelectedTabs";
dropShadowEnabled: true;
backgroundColor: #2e2e2e;
borderColor: #93C789;
.mySelectedTabs {
color: #92de78;
.backGroundPanel {
backgroundImage: Embed(source="/images/bkg.gif");
background-size:"100%";
color: #93C789;
textRollOverColor: #92de78;
dropShadowColor: #92DE78;
Button {
fillAlphas: 1, 1, 1, 1;
fillColors: #000000, #333333, #333333, #000000;
color: #92de78;
textRollOverColor: #cc3333;
borderColor: #93C789;
themeColor: #92de78;
RadioButton {
themeColor: #92DE78;
fillColors: #ffffff, #cccccc, #ffffff, #eeeeee;
color: #0b333c;
CheckBox {
themeColor: #92DE78;
fillColors: #ffffff, #cccccc, #ffffff, #eeeeee;
ComboBox {
themeColor: #92DE78;
fillColors: #ffffff, #cccccc, #ffffff, #eeeeee;
color: #000000;
DateChooser {
headerColors: #000000, #333333;
themeColor: #92DE78;
headerStyleName: "mydateChooserHeaderStyle";
fillColors: #ffffff, #cccccc, #ffffff, #eeeeee;
VScrollBar {
trackColors: #333333, #666666;
themeColor: #000000;
borderColor: #000000;
Panel {
borderColor: #000000;
borderAlpha: 1;
titleStyleName: "mypanelTitle";
dropShadowColor: #000000;
roundedBottomCorners: true;
headerColors: #333333, #000000;
.selectedHeaders{
color :#000000;
font-weight:bold;
.windowStyles {
color: #92de78;
TitleWindow {
color: #92de78;
closeButtonSkin: Embed("/images/del_24.png");
/* Set values from defaults.css to null. */
closeButtonDisabledSkin: Embed("/images/del_24.png");
closeButtonDownSkin:Embed("/images/del_24.png");
closeButtonOverSkin:Embed("/images/del_24.png");
closeButtonUpSkin: Embed("/images/del_24.png");The documentation says that a NumericStepper is composed of a TextInput and 2 buttons so I do understand why the buttons are getting styled the way they are.
I added a Button and a NumericStepper to a text application using Embedded Styles and it did produce the Button style effect. I took the Button out and of course the Numeric buttons were rendered as the default Flex style of off grey / white.
Some of the Flex objects have additional style properties that allow you to style the individual components of the object however the NumericStepper does not seem to have that option.
I think the only way around it would be to get the children of the stepper and style them individually
var btn:Button = numericStepper.getChildAt(1) as Button;
btn.setStyle("fillColors",["#ffcccc","#cccccc"]
and do the same thing for child 2
or extend the NumericStepper and override the style to be what you would like. -
Im having a requirement to load fonts at runtime and display them in a RichEditableText, The text in the RichEditableText could have multiple formats so I use the RichEditableText's setFormatOfRange() method to set the font.
I use a CSS compiled as a SWF to load the fonts, Fonts render when the font is set via the -setStyle() method as demonstrated in the code below
Im using Flash Builder 4 with SDK version 4 to compile the app(Using the default Spark Theme).
Below is the CSS file (fontCSS.css)- You might need to copy fonts from the Widows Font folder for this in a fodler named fonts,
/* CSS file fontCSS.css*/
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
@font-face{
src: url("fonts/Articulate.TTF");
fontFamily: "Articulate123";
embedAsCFF: true;
@font-face{
src: url("fonts/AGENCYB.TTF");
fontFamily: "Agency123";
embedAsCFF: true;
Right Click on the CSS file, in Flash Builder 4 and select "Compile CSS to SWF".
Run the MXML application below and you should see the issue Im trying to describe.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
creationComplete="application1_creationCompleteHandler(event)">
<fx:Script>
<![CDATA[
import flash.utils.describeType;
import flashx.textLayout.formats.TextLayoutFormat;
import mx.collections.ArrayCollection;
import mx.events.CalendarLayoutChangeEvent;
import mx.events.FlexEvent;
import mx.events.StyleEvent;
import spark.events.IndexChangeEvent;
private var swfLoader:Loader
protected function application1_creationCompleteHandler(event:FlexEvent):void
var cssEventDispatcher:IEventDispatcher=styleManager.loadStyleDeclarations("fontCSS.swf")
cssEventDispatcher.addEventListener(StyleEvent.COMPLETE, onComplete);
private function onComplete(event:Object):void
fontList.dataProvider=new ArrayCollection(Font.enumerateFonts())
protected function fontList_changeHandler(event:IndexChangeEvent):void
var tlformat:TextLayoutFormat=new TextLayoutFormat()
tlformat.fontFamily=fontList.selectedItem.fontName
textEditor.setFormatOfRange(tlformat,0,5)
]]>
</fx:Script>
<s:layout>
<s:VerticalLayout/>
</s:layout>
<s:Label text="Please select a font from the list below"/>
<s:List id="fontList" change="fontList_changeHandler(event)">
</s:List>
<s:RichEditableText id="textEditor2"
fontSize="30"
fontFamily="{fontList.selectedItem.fontName}" >
<s:p>Hello - fontFamily set via css binding</s:p>
</s:RichEditableText>
<s:RichEditableText id="textEditor"
fontSize="30"
>
<s:p>Hello - fontFamily set via setFormatOfRange()</s:p>
</s:RichEditableText>
</s:Application>
tried to use an external SWF with the fonts compiled in them Via AS3, that too dosent seem to work, The setStyle() also refuse the work with the below SWF
here is the AS3 project code for your reference
FontEmbedder.as
package
import flash.display.Sprite;
import flash.system.Security;
import flash.text.Font;
public class FontEmbedder extends Sprite
public function FontEmbedder()
Security.allowDomain("*")
[Embed(source="/fonts/Articulate.TTF", fontName="Articulate123", embedAsCFF="true")]
public var articulateFont:Class;
[Embed(source="/fonts/AGENCYB.TTF", fontName="Agency123", embedAsCFF="true")]
public var agencyFont:Class;
We ve been wrecking our heads off to figure out a solution for this. Ultimately decided to post a question here.
Your feedback will be highly appreciated.
Below are snapshots of how the 2 fonts are rendered
Regards.Hi Alex,
I did read through your blog the other day, This must have been thepost you were referring to,
http://blogs.adobe.com/aharui/2010/03/flex_and_embedded_fonts.html
The post is explanatory, but how would we implement this successfully wth code?
A working AS3 code example of your explanation would be more than helpful.
Regards -
Use compc to compile flex runtime css files
Can someone post a command line example of how to compile to
a css file to swf for runtime skinning in flex ?
Thanks,
FirdoshCould you please share your swf and app.xml, packaging, your project (if possible) at [email protected]
I will get a bug logged for this. -
Flex 4.1 Runtime CSS: CSS in module or just CSS
Hi,
I guess this question's answer is obvious but just in case I would like to ask.
I have application which loads a module. I would like to load some fonts before I load the module, so when the module is loaded it displays it's text correctly. So to do that at the moment I load one plain module with a stylesheet in it where I have the embedded fonts, and then I load the module with the text.
Should I not use a module with a stylesheet but compile a stylesheet separately and load it with StyleManager.loadStyleDeclarations() ?
NOTE: Also using the StyleManager I can set true to the second parameter of loadStyleDeclarations which will force updating the styles. How can I do that without loading new stylesheet? I want to do that in case the styles apply for something that is already on screen and I load the module with the styles at a later time.
Another thing is that If I recall correctly if I want to have the stylesheet in swf I need to compile it myself. And with the module with a stylesheet case that happens automatically.
So.. thoughts ?Ok I read it (maybe for 5th time) to recall things a bit. So let me summarize after reading testing etc what I still don't understand:
1) In my application I have 1 custom skin extending Skin.
import custom.CSCSkin;
public var testSkinnn:CSCSkin;
and on creation complete I have:
var testSkin:Class = loaderInfo.applicationDomain.getDefinition("custom.CSCSkin") as Class;
trace(testSkin);
This returns [class CSCSkin].
But the same thing doesn't work in the module because the loaderInfo is null.
So how do you access the applicationDomain of a module ?
2) Looks like I can use almost any component as you say in the siblings and there is no problem, except for the managers classes and Alert. I guess that's because they are singletons with static vars and functions and they register their reference only once - for one application domain and get restrained by it.
I just tried to use Alert only in a module. Application is empty, just a moduleLoader.
import mx.managers.PopUpManager;
private var popUpManager:PopUpManager;
import mx.controls.Alert;
private var alert:Alert;
On creation complete I have:
Alert.show("TESTING","bla");
In the docs it says that registering the singletons/managers in module will make it throw error when you try to use it in a sibling module. But the fact is that the Alert doesn't work at all even in the module I registered them first - it throws error with the PopUpManager. To make the Alert work I had to move the Alert and PopUpManager declarations to the main application. Then they started working everywhere.
Why the Alert is not working if used only in one module? -
Hi,
I have the follow problem.
My Flex application receives some initial parameters from an
aspx page, it starts and it calls a Web Service in order to obtains
some information like css file position, some labels in the
front-end, etc
I know that in mxml syntax there is the tag:
<mx:Style source="
http://myserver/mypath/style.css"
/>
but my application is completley developed in actionscript.
My WebService returns me a XML and a specific tag of this XML
contains the information I need, like this:
<CssFilePath>
http://myserver/mypath/style.css</CssFilePath>
Is it possible to set in action script in run time the
location of the css file? Which is the right code?
Any suggestion will be appreciated.
Thank you.There is information about loading runtime CSS files here:
http://livedocs.adobe.com/flex/3/html/styles_10.html
Basically, you need to compile the CSS file to a SWF so you
can load it at runtime.
hth,
matt horn
flex docs -
Unable to apply embedded font swf to text in text layout framework
Hello,
We have created a swf for a given font (for e.g., Calibri.swf) which contains all the styles (Regular, Italic, Bold, BoldItalic).
We have created a xml which lists the name of the font and the corresponding swf file path. The names from the xml are loaded into a combo box in the application.
When we try to apply the selected font to a text in the text layout framework, it does not apply the same. It sets the font to default "Times" font.
Following is a snippet of code to apply the font to the text:
private function selectFont(fontXML:XML):void {
var path:String = fontXML.@source;
var myEvent:IEventDispatcher = styleManager.loadStyleDeclarations(FlexGlobals.topLevelApplication.url.substring(0,FlexGl obals.topLevelApplication.url.lastIndexOf("/"))+"/"+path);
myEvent.addEventListener(StyleEvent.COMPLETE, function(event:StyleEvent):void{
var editManager:EditManager = textFlow.interactionManager as EditManager;
var itextLayout:TextLayoutFormat = new TextLayoutFormat();
itextLayout.fontSize = 20;
var fontName:String = fontXML.@name;
Alert.show(fontName);
itextLayout.fontFamily = fontName;
Alert.show( "itext = " + itextLayout.fontFamily);
editManager.applyFormat(itextLayout,itextLayout,itextLayout);
var flowLeafElement:FlowElement = textFlow.findLeaf(editManager.anchorPosition) as FlowElement;
editManager.changeStyleName(fontName,flowLeafElement);
Can anyone please let us know what is missing in the implementation?
Thanks in advance.
VikramMy recommendation: unless you really care about ISWFContext implementations and the application domain issues, ignore Alex's post about embedded fonts.
It is a nice discussion about the inner workings of the domain and security of how this works but it is imho broken and is an insane concept to require an ISWFContext to just use an embedded font. It also breaks runtime CSS loading that has fonts embedded in it because the Flex compiler (last I checked) was also busted – it doesn't include the function necessary to create within context the font embed so that it may be applied. You can't create an ISWFContext with a compiled CSS file.
These issues were introduced in the last Flex SDK beta before FB4 was released in final form. There are multiple bugs logged against the issue of applying loaded font files to TLF text (in short, SWFContext is broken and you have to override GlobalSettings.resolveFontLookupFunction to return embedded or null, all the time).
Here's some more details to get you started - with links to at least one of the SDK bugs that were filed:
http://forums.adobe.com/message/2656152
For example:
import flashx.textLayout.elements.GlobalSettings;
import flash.text.engine.FontLookup;
GlobalSettings.resolveFontLookupFunction = function makeValid():String { return FontLookup.EMBEDDED_CFF };
And you may need to do this after your font is loaded:
yourTextBlock.textFlow.invalidateAllFormats();
Disclaimer: I haven't seen the latest Flex SDK release to see if this was fixed. I have an AIR application with native process that builds embedded font SWF files for use and stub code for FB4 usage but haven't updated to the latest SDK yet to see if it's working properly.
Anyhow, your best bet is to look at the Flash Builder forums. I think this is/was a Flex team issue, not TLF. -
How to dispatch an event from the application to the preloader
HI everyone
I've been searching everywhere on the net, and as far as it goes I gotten no answer for this. When the application hit the preinitialize phase, I'm calling the loadStyle method. As you can see I will hold the CreationComplete event until I the swf is ready. What I want to do, is to have a second loading bar in the preloader (no problem here) to show the progress of the swf downloaded, hence the StyleEvent.PROGRESS event. I would like to know how can I dispatch that event to the preloader?
///////////////////APPLICATION
import mx.events.StyleEvent;
import mx.styles.StyleManager;
private function loadStyle():void
var eventDispatcher:IEventDispatcher = StyleManager.loadStyleDeclarations("cl/elmelej/mangiare/estilo/estilo.swf");
eventDispatcher.addEventListener(StyleEvent.COMPLETE, completeHandler);
eventDispatcher.addEventListener(StyleEvent.PROGRESS,progreso);
private function completeHandler(event:StyleEvent):void
super.initialized = true;
private function progreso(event:StyleEvent):void
override public function set initialized(value:Boolean):void
// Hold off until the Runtime CSS SWF is done loading.
///////////////////////////////////PRELOADER
virtual public function set preloader(value:Sprite):void
_preloader = value;
value.addEventListener(ProgressEvent.PROGRESS, progressHandler);
value.addEventListener(Event.COMPLETE, completeHandler);
value.addEventListener(StyleEvent.PROGRESS, progressHandlerCSS);
value.addEventListener(FlexEvent.INIT_PROGRESS, initProgressHandler);
value.addEventListener(FlexEvent.INIT_COMPLETE, initCompleteHandler);
As you can see, the preloader is listening to StyleEvent.PROGRESS events, but I cant dispatch that event to the preloader so that it can react to it. I hope you can help me. Thanks for your time and help
SebastiánAlex,
Thank you very much for the fast answer, but I'm not an advanced programmer in Flex, so I would need a bit more help from you. I wouldlike you to tell me if it is possible to do what I want to do? and could you be more specific n the information you gave me please?
I think you mean something like this:
private function progreso(event:StyleEvent):void
(this.systemManager.getChildAt(systemManager.numChildren) as Preloader).getChildAt(XXXXXXXX).dispatchEvent(event)
/////////////////////// (this.systemManager.getChildAt(systemManager.numChildren) as Preloader)) -------->gets the preloader
///////////////////////(this.systemManager.getChildAt(systemManager.numChildren) as Preloader).getChildAt(XXXXXXXX) -------------> would get the progressbar (only If I have XXXXXvalue)
let me tell you that the method that I posted on the last message was a part of this class:
public class PreloaderDisplayBase extends Sprite implements IPreloaderDisplay
PreloaderDisplayBase is my Preloader.
I hope you can help me.
Thanks Again
Sebastián Toro O -
Flex 4... enterprise applications - global styling strategy
If I want to be able to change the whole application's feel and look without recoding at all - what would a major strategy of acheiving this be?
Any learning materials are very welcome.
ThanksExternal CSS file ofcoz, and if you are mentioneing the skin classes in the CSS itself, it will be good. Also, you can change the styles at run time, see the url below.
runtime css
external style -
Embed font source problem?
hi =)
recently, i was trying to embed fonts into my flex app... so,
i followed the normal procedure:
<mx:Style>
@font-face
src:url(" [ path here ] ");
fontFamily: "myfont";
</mx:Style>
but, irregardless of me putting this code within the mxml or
the stylesheet, the "src:url" just would not accept relative paths
to the font... in my case, it only works if i put the absolute
path... and, yes, the relative paths i placed were correct...
however, it's always telling me this : "
unable to resolve 'font_name' for transcoding" . i checked
the official site on how to troubleshoot this and all they tell is
to basically check if the path is correct... and i am very sure my
paths were correct and that the font does exist in that path...
what am i doing wrong? thanks in advance for replies!Ok, make sure you're mimicking this:
http://blog.flexmonkeypatches.com/2007/02/23/using-runtime-css-to-change-embedded-true-typ e-fonts-at-runtime-in-flex-applications/#more-15
although I like this method better:
http://blog.flexmonkeypatches.com/2007/02/12/changing-embedded-true-type-fonts-at-runtime- in-flex-applications/
Now the trick is, whatever .as or .css file you make, you
have to drag that file over the mxmlc.exe icon to turn it into a
swf, and then Flex loads the swf.
Hope that helps. -
How to set borderColor from css during runtime
Hi,
I need to set the border color of a selected tab during runtime from css. Is it possible. Please help i am struggling with this for past two days.
regards,
Jayagopal.Just create a selected CSS style, and update the styleName of the tab when it is selected.
-
Hello ,
I am using km/docs/etc/wpceditor/css/runtime/File.css for web content where File.css is a custom stylesheet. This works fine. If I upload more than one custom style sheets, all of them are simultaneously used even though am only referencing one style sheet in the custom JSP layout. How can I use only one custom style sheet that I reference in my JSP layout:
<LINK REL="stylesheet" HREF="irj/go/km/docs/etc/wpceditor/css/runtime/File.css" />Hi Vishal,
Can you be more specific when you said
"But if some styles does not match in that specified css Then it will refer the other css present at runtime folder."
In my case,am using 3 custom style sheets(File1.css, File2.css, File3.css). At run time, all my pages are using all 3 style sheets, even though, I have referenced only one stylesheet in the JSP layout:
<LINK REL="stylesheet" HREF="irj/go/km/docs/etc/wpceditor/css/runtime/File1.css" />
Thanks for your response. -
DW CS3 - How to determine which CSS stylesheet to use at runtime ?
I'm building a website that can be used by different
companies. I want to use CSS so that when a user from Company_123
logs in, then they see a website in the style of Company_123's
corporate colours. However if a user from Company_ABC logs in, then
they see a website in the style of Company_ABC's corporate colours.
The site will potentially be used by dozens of different
companies so if possible I'd rather avoid having to implement a
sort of multiple "if company = 123 use this CSS, if company = ABC
use this CSS, etc, etc" at the top of every single web page I
produce.
Whats the best way to implement this ?
As far as I can see, when I create a new external CSS in DW
CS3, there is nothing dynamic in its title that allows anything to
be determined at runtime ?
Thanks in advance........Gav.Different sizes of what? If screens then it's a wasted
effort.... You can
know my screen size but you have no idea of my browser
viewport size.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"newlinp" <[email protected]> wrote in
message
news:fvsa5b$87o$[email protected]..
>I would suggest using a stylesheet switcher...
>
>
http://www.alistapart.com/stories/alternate/
>
> Ive used it at
http://churchillretirement.co.uk
website to switch CSS for
> different sizes - I reckon you could do much the same
here..
> -
Hello,
I need to know if changing the CSS file in runtime can be done, and if so, how can I do it.
Thanks in advance,
Rui BelchiorYou can set where condition of your data block using set_block_property('your_block_name',default_where,your_condition);
go_block('your_block_name');
execute_query;
This will execute query according to your new condition.
Make sure to reset default_where if you want to view all data.
Check in the on line help, also; there is example of use of default_where.
Hope it helps you,
Fabrizio
Maybe you are looking for
-
LocalStorage in iBooks without iTunes Author?
Dear Community I'm trying to find a way to make localStorage work for a regular ePub3 file. The goal is to create an chapter1.xhtml, that will offer a quiz with a number of radio buttons and and a button that calls a JS funcion to store the value of
-
Some comments on PDFs are not printed
Hello, I've noticed that when making comments in Acrobat XI Pro, some of the comments are not printed as they are shown on the screen. For example, on one document I have a text box with two lines of text in it, but only the border of the text box an
-
ITunes says "Please try a new name for your calendar" and closes
The entire message says, "sorry that username is taken. Please try a new name for your calendar itunes" and the locks up and shuts down. It then reopens and the process begins again. I am running current versions of iTunes and Leopard. I have tried r
-
Original date showing is wrong by two years!
Hi, I seem to have a big (and very weird) problem with dates in Lightroom. This relates - for the moment at least - to images dating back ten years, to when I had my first digital camera, a Nikon D100. See attached image. My belief is that the photo
-
How to check Materials without bin assignment?
Hi all, Is there a way, i may check all materials in my warehouse without bin assignment. Regards