styling

Angular 5: How to define color pallet in a central file

只谈情不闲聊 提交于 2019-12-11 05:06:19
问题 I want to declare my color pallet in a central file in my project. Currently I am using an Injectable which contains a map, to reference all my used colors. Example: @Injectable() export class COLOR_DICTIONARY { private static COLOR_MAP: Map<string, string> = new Map<string, string>(); constructor() { COLOR_DICTIONARY.COLOR_MAP.set('primary', '#339988'); } get(key: string) { return COLOR_DICTIONARY.COLOR_MAP.get(key); } } However this forces me to reference all the colors in the markup

change Expander header ContentPresenter HorisontalAlign property

泄露秘密 提交于 2019-12-11 04:48:23
问题 I want to have a custom header in the Expander control. I want to have a header text with left alignment and a picture with a right alignment: <Expander> <Expander.Header> <DockPanel LastChildFill="True" HorizontalAlignment="Stretch"> <TextBlock DockPanel.Dock="Left" Text="Some Header Text"/> <Image DockPanel.Dock="Right" HorizontalAlignment="Right" /> </DockPanel> </Expander.Header> <StackPanel > <ItemsPresenter /> </StackPanel> </Expander> Unfortunately the header is rendered inside of an

Set Style Setter value from code-behind at runtime

烂漫一生 提交于 2019-12-11 04:22:41
问题 In silverlight, there is a known textbox caret bug that is discussed here: http://forums.silverlight.net/p/165276/423268.aspx As a workaround, an attached behaviour is used that allows to specify the color for TextBox caret explicitly. Therefore I have the following setter in my TextBox style: <Style x:Key="NameEditStyle" TargetType="TextBox"> <Setter Property="Utilities:FixCaretBrushBehavior.CaretBrush" Value="White" /> My application is running on Windows Phone, where there can be both

Styling a textarea with JavaScript

非 Y 不嫁゛ 提交于 2019-12-11 03:35:16
问题 I'm absolutely new to JavaScript and would like to modify a textarea of a form (which is generated by an external script) as follows: 1.) Textarea on start: Labeled 'Your message here' in color 'rgb(136, 136, 136)' 2.) Textarea on focus: Label removed and color set to 'rgb(0, 0, 0)' 3.) Textarea on blur: Color of user input set to 'rgb(136, 136, 136)'; if there's no input, label reappears in color 'rgb(136, 136, 136)' I've experimented around with var foo = document.getElementById('HCB

How to display partially bold text in QListWidgetItem with QtCore.Qt.UserRole

℡╲_俬逩灬. 提交于 2019-12-11 03:33:57
问题 I want to display a single word in a QListWidgetItem in bold font. According to this related post, it should be possible to use QtCore.Qt.UserRole for this purpose. However, the sample code provided did not work for me. (Since I'm a beginner, I most likely forgot a definition, but I don't know which one.) This is what I have so far: main.ui <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>Dialog</class> <widget class="QDialog" name="Dialog"> <property name="geometry"> <rect>

Styling Open-Ended Text Inputs [closed]

眉间皱痕 提交于 2019-12-11 02:29:56
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 8 years ago . What's the best / recommended practice to treat a text input that contains HTML tags? The idea is to properly display the input e.g.

Using custom HTML attributes for JavaScript purposes? [closed]

限于喜欢 提交于 2019-12-11 01:59:37
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . One of my colleagues doesn't like to use HTML classes and ids for javascript/jQuery purpose. Therefore I've seen that he had created

Caret disappears when the background of a textbox is gray in wpf

て烟熏妆下的殇ゞ 提交于 2019-12-10 23:29:51
问题 I have a textbox in wpf defined as follow: <TextBox Grid.Column="4" Grid.Row="1" x:Name="InputDirectory" Margin="2" Background="Gray"/> when I run application, it doesn't show caret, if I remove background colour or change it to other colours ( I tested white, black and blue) the caret appears. How can I make sure that caret appears when background is Gray? 回答1: Try CaretBrush="Tomato" the color used by the CaretIndicator might be the same as the Background currently. So say: <TextBox x:Name=

Creating default style for custom control

倖福魔咒の 提交于 2019-12-10 20:46:59
问题 Im currently creating a custom control (based on the WPF DataGrid). What i would like to do is to set default styling on the datagrid. Currently im setting the Style property which works. But my problem arrises when i create a style to change fx. the background color in the main applications app.xaml. Then all my "default" styling is lost and the DataGrid looks all standard only with the background property set. I have tried using OverrideMetadata on each of the properties on the grid that i

WPF Nested Styles

孤街浪徒 提交于 2019-12-10 18:19:41
问题 I have TextBlocks and Comboboxes in my application i want the Textblock foreground to be white and the Combobox Foreground to be Black. What i tried was: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Style TargetType="{x:Type TextBlock}"> <Setter Property="Foreground" Value="White" /> </Style> <Style TargetType="{x:Type ComboBox}"> <Setter Property="Foreground" Value="Red" /> </Style> <