Changes between Version 5 and Version 6 of documentation/StyleGuide

Show
Ignore:
Author:
peterc (IP: 203.96.63.172)
Timestamp:
02/14/08 14:04:51 (10 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • documentation/StyleGuide

    v5 v6  
    151151The ''select'' element generates three hidden elements: 
    152152 * ''selectvalue'': The container element for the selected option. 
    153  * ''selectarrow'': The button rendered to the right of the value element. 
     153 * ''selectarrow'': The button rendered to the right of the value element. This element has the pseudo-class 'checked' set on it when the selection box is visible. 
    154154 * ''selectbox'': The box containing the options. The visibility of this element is toggled when the arrow or value elements are clicked on, or when an option is selected. 
    155155 
    156156[[Image(styleguide_2.gif, nolink)]] 
     157 
     158=== Example RCSS === 
     159 
     160The following are the select element's RCSS rules and properties from the Rocket Invaders from Mars style sheet: 
     161 
     162{{{ 
     163/* Specify the dimensions of the select element. */ 
     164select 
     165{ 
     166        width: 175px; 
     167        height: 37px; 
     168} 
     169 
     170/* Specify the dimensions of the value element within the select element. Padding is used to position the 
     171   value correctly internally. */ 
     172select selectvalue 
     173{ 
     174        width: 125px; 
     175        height: 28px; 
     176        padding: 9px 10px 0px 10px; 
     177 
     178        background-decorator: image; 
     179        background-image: invader.png 162px 192px 307px 229px; 
     180} 
     181 
     182/* Animate the value field when it is hovered. */ 
     183select selectvalue:hover 
     184{ 
     185        background-image-t: 230px 267px; 
     186} 
     187 
     188/* Fix the size of the select arrow decorate the element. */ 
     189select selectarrow 
     190{ 
     191        width: 30px; 
     192        height: 37px; 
     193         
     194        icon-decorator: image; 
     195        icon-image: invader.png 307px 192px 337px 229px; 
     196} 
     197 
     198/* Animate the arrow when hovered. */ 
     199select selectarrow:hover 
     200{ 
     201        icon-image-t: 230px 267px; 
     202} 
     203 
     204/* Animate the arrow when the button is pressed or the box is visible. */ 
     205select selectarrow:active, 
     206select selectarrow:checked, 
     207{ 
     208        icon-image-t: 268px 305px; 
     209} 
     210 
     211/* Fix the width of the select box and fiddle with the margins to get it in exactly the right place. */ 
     212select selectbox 
     213{ 
     214        margin-left: 1px; 
     215        margin-top: -7px; 
     216        width: 162px; 
     217        padding: 1px 4px 4px 4px; 
     218 
     219        background-decorator: tiled-box; 
     220        background-top-left-image: invader.png 281px 275px 292px 284px; 
     221        background-top-right-image: invader.png 294px 275px 305px 284px; 
     222        background-top-image: invader.png stretch 292px 275px 293px 284px; 
     223        background-bottom-left-image: invader.png 281px 285px 292px 296px; 
     224        background-bottom-right-image: invader.png 294px 285px 305px 296px; 
     225        background-bottom-image: invader.png stretch 292px 285px 293px 296px; 
     226        background-left-image: invader.png stretch 281px 283px 292px 284px; 
     227        background-center-image: invader.png stretch 292px 283px 293px 284px; 
     228} 
     229 
     230/* Sizes the option element to take up the available width in the select box. */ 
     231select selectbox option 
     232{ 
     233        width: auto; 
     234        padding-left: 3px; 
     235} 
     236 
     237/* Specifies every second option in the selection box to have a white background. */ 
     238select selectbox option:nth-child(even) 
     239{ 
     240        background: #FFFFFFA0; 
     241} 
     242 
     243/* Gives the red highlight to the selection box. */ 
     244select selectbox option:hover 
     245{ 
     246        background: #FF5D5D; 
     247} 
     248}}}