WebConditionalLook
Package: Libraries.Web.Styles · Inherits from: Libraries.Language.Object
WebConditionalLook is a style or layout that an element takes only sometimes: on screens at least some width wide, while the pointer is over it or it is pressed, while it has keyboard focus, while it is disabled, unavailable or empty, while it is the selected tab or the current item, while it is first or last in its parent, or while it sits inside a disabled control. It changes only what it sets; everything else stays as the element's own look says. A page makes these with SetStyleFromWidth, SetLayoutFromWidth, SetStyleOnHover, SetStyleOnFocus, SetStyleWhenPressed, SetStyleWhenDisabled, SetStyleWhenEmpty, SetStyleWhenSelected, SetStyleWhenCurrent and SetStyleInsideDisabled; people making pages don't use this class directly.
Variables
text AFTER_CHECKED: inside the drawn switch, while it is checked.text HOVER: The states a look can apply in, as the stylesheet names them.text INSIDE_AFTER_CHECKED: Makes this a style for screens at least this wide.text CURRENT: belongs.text INSIDE_DISABLED: state ending in a space is written before the element's class.text FOCUStext AFTER_KEYBOARD_FOCUS: inside the drawn switch, while it is checked.text KEYBOARD_FOCUS: belongs.text EMPTYtext INVALIDtext DISABLEDtext UNAVAILABLE: can't be followed yet; unlike DISABLED, it can still take focus.text FIRST: The first and last of the elements in the same parent.text SELECTED: slide shown (aria-current, any value but "false").text PRESSED: slide shown (aria-current, any value but "false").text LAST: state ending in a space is written before the element's class.
Actions
Generate()
Returns the declarations this look sets. WebSite calls this when it writes the stylesheet.
Returns
text: The declarations.
GetFromWidth()
Returns the narrowest screen this look applies on, or -1 if it applies on every screen.
Returns
number: The width in pixels, or -1.
GetState()
Returns the state this look applies in, or nothing if it applies in every state.
Returns
text: The state, such as ":hover", or nothing.
SetLayoutFromWidth(number pixels, Libraries.Web.Layouts.WebLayout value)
Makes this a layout for screens at least this wide.
Parameters
pixelsnumber: The narrowest screen the layout applies on.valueLibraries.Web.Layouts.WebLayout: The layout.
SetStyleFromWidth(number pixels, Libraries.Web.Styles.WebStyle value)
Makes this a style for screens at least this wide.
Parameters
pixelsnumber: The narrowest screen the style applies on.valueLibraries.Web.Styles.WebStyle: The style.
SetStyleInState(text stateName, Libraries.Web.Styles.WebStyle value)
Makes this a style for a state, such as HOVER, FOCUS, INVALID (a form field its page marks as filled in wrongly), DISABLED, EMPTY, PRESSED, SELECTED, CURRENT, KEYBOARD_FOCUS, UNAVAILABLE, FIRST, LAST or INSIDE_DISABLED.
Parameters
stateNametext: The state, one of this class's constants.valueLibraries.Web.Styles.WebStyle: The style.