Apply Sketch Styles to all controls in SketchFlow Application - styles

Is there a way to globally apply the Sketch Styles to all controls within my SketchFlow application in Expression Blend 4 without having to apply the Style="{DynamicResource Foo-Sketch}" property to each and every control manually?
Generally spoken, I would like to make those styles defined in SketchStyles.xaml implicit.

You can probably apply the styles implicitly like this:
<UserControl.Resources>
<Style BasedOn="{StaticResource Button-Sketch}" TargetType="Button"/>
</UserControl.Resources>
You would have to do this for each control type you want to use an implicit style for.

Related

Conflicts between Custom theme CSS and Liferay CSS

I am trying to customize the Liferay UI by using custom theme using base as as "_Styled" theme.
I have my own css files which I coped to _diff/css folder of theme and imported them "custom.css" file .However its breaking the presentation of liferay.In my custom CSS I have styles defined for all the standard tags like body,div etc which is impacting the liferay UI too.
How can I resolve this conflict? Thanks in advance!
Quick (and not the best) solution is to remove contents of liferays css file (for example "base.css") and save this empty file in /diff/css/ folder of your theme. This way the base.css will get overriden with your new empty file and thus no styles will get loaded. And your custom.css will be the only stylesheet that is taken into account.
Well, of course it all has an effect on the rest of Liferay as well. Liferay provides quite a bit of the HTML DOM of your page, and if you change the presentation of all of those elements, you'll have to take care to style Liferay's elements too.
Is this a conflict? No. Let's go for the simplest case: You declare div {color:green;}. Of course, now everything, your components as well as Liferay's components, use green text. If you only want to style your own portlets, you might want to specify some portlets: div.portlet-my-own-application {color:green;}
I know that color is a too simple usecase, but I hope it illustrates the solution strategy.
Rather than following Artem Khojoyan's suggestion to override Liferay's base.css, I'd recommend to take a look at the resulting css, what's effective etc., and simplify your own css - adapt it to be used within Liferay - by inspecting the effective CSS for every elements that looks off. Firebug or any of it's relatives are your friend.
I'm afraid, with the details "I'm doing something which has an effect on Liferay UI" there's nothing much more to help you. In fact, I'd hope that what you do has an effect on Liferay's UI... You'll just need to find the proper CSS code
Ideally if your styles are loaded from custom.css, then will overwrite liferay default styles.
In some cases, to overwrite a style in css, you can use !important
for example, liferay default style
body {
background-color: #fff
}
You can specify your style to consider irrespective of order of loading
body {
background-color: red !important;
}

How can i assign two styles to a placemark

i am new to KML and this should be simple but i can't figure it out.
In my KML i have several styles defined and can assign them easily to a specific placemark with the styleUrl-tag. My styles differ only in the background-color from each other but they also contain a rather complicated "BalloonStyle" which is the same for ALL of them.
Now i don't want to copy this same ballonstyle into every style i have and increase the size of my KML.
What i need is to assign to a placemark two styles like i would do in CSS:
<styleUrl>#greenArea #myBalloonStyle</styleUrl>
<styleUrl>#redArea #myBalloonStyle</styleUrl>
Or write into my style something that it "inherits" its balloon-style from a second style.
Thank you in advance
A KML feature can only contain a single styleUrl with a single style reference but the feature can also contain an inline Style element. This technique is called a "merged" style.
In the case where a feature has both a shared style and inline style, the shared style is applied first then the inline style overrides whatever is already specified in the former.
If you use the BallonStyle as a shared style then you can override specific elements such as color in the inline style.
<Placemark>
<styleUrl>#myBalloonStyle</styleUrl>
<Style>
<LabelStyle>
<color>ff0000cc</color>
</LabelStyle>
</Style>
</Placemark>
Here's a complete example with a global BalloonStyle. Click "Raw", save contents to a local file, then open in Google Earth.

Orchard CMS: Add a stylesheet to a page

Setup:
I am using Orchard CMS 1.6.
I have a site where I need to be able to set the background color of the whole page. Ie, I need to style the body tag.
I could use the LayoutSelector module and have distinct layouts. However, the only difference in each layout is that the background-color rule for the body tag is different. So it seems a very un-dry way of doing things.
I can't find any way to make Vandelay.Classy add a distinct id or class to the body tag (it adds, as I understand it) an id or a class to the outer tag of a content type. In my case, that isn't the body tag.
So that is no good, I really do need to customize the body tag.
How to do this?
Note:
I need 3 different background colors. I also have a two column layout and a three column layout. [I use (a modified version of) the layoutSelector module to achieve this.] So to have 3 different colors of background, and I used layouts to achieve this, I would need 6 different layouts: TOTAL overkill.
There must be a better way...
From any cshtml file, you should be able to access the Layout shape. From pretty much anywhere else, you can still get to the Layout shape through WorkContextAccessor. Once you have a reference to the Layout shape, you can do Layout.Classes.Add("the-class-you-want").

JSF to set style in stylesheets?

So I'm trying to create a webpage with customizable style for each user. You can save style options as strings in a JSF bean property and access them in inline style attributes, or <style> tags within a webpage very easily, but who uses inline/onpage styling anymore?
Is there any way to forward these properties from a JSF (2.0) bean to my stylesheet or am I required to simply add <style> blocks to the pages I wish to be customizable?
EDIT: I guess I could make a function to write these properties to a stylesheet, making one for each user, but this is obviously not preferred.
For full customization, you could save stylesheets for all the changeable elements and their style options and reference these with your bean properties.
Since that is quite a bit of stylesheets though, you could just define your own style schemes and give the users a choice between these pre-defined stylesheets. This doesn't exactly answer your question but would save a lot of work
I'm not sure exactly what your functionality is, but one option would be ->
<h:outputStylesheet library="css" name="#{userBean.styleSheetName}" />
Where the "UserBean" had names of sheets.
Alternatively you could just output the stylesheet (as you said) inbetween the style tags. If you wanted to go nuts you could write a servlet that read the user's session and generated a cached stylesheet.
I would definitely go the servlet route for the functionality you're suggesting, but if it is just a "set" of stylesheets the users have access to, I would probably use a simple dynamic property as per the first example.

Overriding default control templates - ListTitleViewSelectorMenu

I am following the example given here to override the default DocumentLibraryForm rendering template
MSDN - Override a Default Control Template
<SharePoint:RenderingTemplate ID="DocumentLibraryForm" runat="server">
... Custom stuff here ..
</SharePoint:RenderingTemplate>
(Thats the 2007 version, the 2010 version is the same but not complete, it doesn't show the directives)
And that all works just fine. There are lots of other examples on t'internet of overriding control rendering templates.
However I am trying to override things like ListTitleViewSelectorMenu and that isn't working.
<!-- Definition from allitems.aspx -->
<SharePoint:ListTitleViewSelectorMenu AlignToParent="true" id="LTViewSelectorMenu" runat="server" />
SharePoint:RenderingTemplate can only be used to override defined templates, usually in the generation of forms and list views. I dont think they can be used to replace random controls that are placed on page layouts.
I think i have tried what you are trying do, customise that view dropdown on list layout pages. I have an control that shows it sorted. The way that you replace controls is with a DelegateControl (http://msdn.microsoft.com/en-us/library/ms470880.aspx), but unfortuately ListTitleViewSelectorMenu is not wrapped by a DelegateControl in the standard list layouts. You may have to replace the entire bread crumb.

Resources