sketch
Types
Strategy for the Cache. Two strategies are available as of now: ephemeral and persistent. In the first case, the cache is throwable, and every class generation wil rely on hashing function. It means two class names will be identical if their content are identical. In the second case, the cache is persistent, meaning it will keep the memories of the generated classes.
pub type Strategy {
Ephemeral
Persistent
}
Constructors
-
Ephemeral
-
Persistent
Functions
pub fn accent_color(value: String) -> Style
pub fn align_content(align: String) -> Style
pub fn align_items(align: String) -> Style
pub fn align_self(align: String) -> Style
pub fn align_tracks(align: String) -> Style
pub fn animation_composition(animation: String) -> Style
pub fn animation_delay(animation: String) -> Style
pub fn animation_direction(animation: String) -> Style
pub fn animation_duration(animation: String) -> Style
pub fn animation_fill_mode(animation: String) -> Style
pub fn animation_iteration_count(animation: String) -> Style
pub fn animation_name(animation: String) -> Style
pub fn animation_play_state(animation: String) -> Style
pub fn animation_timing_function(animation: String) -> Style
pub fn appearance(appearance: String) -> Style
pub fn aspect_ratio(aspect_ratio: String) -> Style
pub fn backdrop_filter(value: String) -> Style
pub fn backface_visibility(value: String) -> Style
pub fn background(background: String) -> Style
pub fn background_attachment(value: String) -> Style
pub fn background_blend_mode(value: String) -> Style
pub fn background_clip(value: String) -> Style
pub fn background_color(value: String) -> Style
pub fn background_image(value: String) -> Style
pub fn background_origin(value: String) -> Style
pub fn background_position(value: String) -> Style
pub fn background_position_x(value: String) -> Style
pub fn background_position_y(value: String) -> Style
pub fn background_repeat(value: String) -> Style
pub fn background_size(background: String) -> Style
pub fn block_size(value: Size) -> Style
pub fn block_size_(value: String) -> Style
pub fn border_block(value: String) -> Style
pub fn border_block_color(value: String) -> Style
pub fn border_block_end(value: String) -> Style
pub fn border_block_end_color(value: String) -> Style
pub fn border_block_end_style(value: String) -> Style
pub fn border_block_end_width(value: Size) -> Style
pub fn border_block_end_width_(value: String) -> Style
pub fn border_block_start(value: String) -> Style
pub fn border_block_start_color(value: String) -> Style
pub fn border_block_start_style(value: String) -> Style
pub fn border_block_start_width(value: Size) -> Style
pub fn border_block_start_width_(value: String) -> Style
pub fn border_block_style(value: String) -> Style
pub fn border_block_width(value: Size) -> Style
pub fn border_block_width_(value: String) -> Style
pub fn border_bottom(value: String) -> Style
pub fn border_bottom_color(value: String) -> Style
pub fn border_bottom_left_radius(
border_bottom_left_radius: Size,
) -> Style
pub fn border_bottom_left_radius_(
border_bottom_left_radius: String,
) -> Style
pub fn border_bottom_right_radius(
border_bottom_right_radius: Size,
) -> Style
pub fn border_bottom_right_radius_(
border_bottom_right_radius: String,
) -> Style
pub fn border_bottom_style(value: String) -> Style
pub fn border_bottom_width(value: Size) -> Style
pub fn border_bottom_width_(value: String) -> Style
pub fn border_collapse(value: String) -> Style
pub fn border_color(value: String) -> Style
pub fn border_end_end_radius(value: String) -> Style
pub fn border_end_start_radius(value: String) -> Style
pub fn border_image(value: String) -> Style
pub fn border_image_outset(value: Size) -> Style
pub fn border_image_outset_(value: String) -> Style
pub fn border_image_repeat(value: String) -> Style
pub fn border_image_slice(value: String) -> Style
pub fn border_image_source(value: String) -> Style
pub fn border_image_width(value: Size) -> Style
pub fn border_image_width_(value: String) -> Style
pub fn border_inline(value: String) -> Style
pub fn border_inline_color(value: String) -> Style
pub fn border_inline_end(value: String) -> Style
pub fn border_inline_end_color(value: String) -> Style
pub fn border_inline_end_style(value: String) -> Style
pub fn border_inline_end_width(value: Size) -> Style
pub fn border_inline_end_width_(value: String) -> Style
pub fn border_inline_start(value: String) -> Style
pub fn border_inline_start_color(value: String) -> Style
pub fn border_inline_start_style(value: String) -> Style
pub fn border_inline_start_width(value: Size) -> Style
pub fn border_inline_start_width_(value: String) -> Style
pub fn border_inline_style(value: String) -> Style
pub fn border_inline_width(value: Size) -> Style
pub fn border_inline_width_(value: String) -> Style
pub fn border_left(value: String) -> Style
pub fn border_left_color(value: String) -> Style
pub fn border_left_style(value: String) -> Style
pub fn border_left_width(value: Size) -> Style
pub fn border_left_width_(value: String) -> Style
pub fn border_radius(border_radius: Size) -> Style
pub fn border_radius_(border_radius: String) -> Style
pub fn border_right(value: String) -> Style
pub fn border_right_color(value: String) -> Style
pub fn border_right_style(value: String) -> Style
pub fn border_right_width(value: Size) -> Style
pub fn border_right_width_(value: String) -> Style
pub fn border_spacing(value: Size) -> Style
pub fn border_spacing_(value: String) -> Style
pub fn border_start_end_radius(value: String) -> Style
pub fn border_start_start_radius(value: String) -> Style
pub fn border_style(value: String) -> Style
pub fn border_top(value: String) -> Style
pub fn border_top_color(value: String) -> Style
pub fn border_top_left_radius(
border_top_left_radius: Size,
) -> Style
pub fn border_top_left_radius_(
border_top_left_radius: String,
) -> Style
pub fn border_top_right_radius(
border_top_right_radius: Size,
) -> Style
pub fn border_top_right_radius_(
border_top_right_radius: String,
) -> Style
pub fn border_top_style(value: String) -> Style
pub fn border_top_width(value: Size) -> Style
pub fn border_top_width_(value: String) -> Style
pub fn border_width(value: Size) -> Style
pub fn border_width_(value: String) -> Style
pub fn box_shadow(box_shadow: String) -> Style
pub fn box_sizing(box_sizing: String) -> Style
pub fn cache(
strategy strategy: Strategy,
) -> Result(Cache, SketchError)
Create a cache, managing the styles. You can instanciate as much cache as
you want, if you need to manage different stylesheets.
Instanciating an Ephemeral
always succeed.
pub fn caption_side(value: String) -> Style
pub fn caret_color(value: String) -> Style
pub fn class_name(class: Class, cache: Cache) -> #(Cache, String)
Convert a Class
to its proper class name, to use it anywhere in your
application. It can have the form class1
or class1 class2
in case of
classes composition.
pub fn color_interpolation(value: String) -> Style
pub fn color_scheme(value: String) -> Style
pub fn column_count(value: String) -> Style
pub fn column_fill(value: String) -> Style
pub fn column_gap(column_gap: Size) -> Style
pub fn column_rule(value: String) -> Style
pub fn column_rule_color(value: String) -> Style
pub fn column_rule_style(value: String) -> Style
pub fn column_rule_width(value: String) -> Style
pub fn column_span(value: String) -> Style
pub fn column_width(value: String) -> Style
pub fn compose(class: Class) -> Style
Compose styles by inheriting class, and later overrides them. Every styles from the class will be composed in the resulting class.
pub fn contain_intrinsic_block_size(value: Size) -> Style
pub fn contain_intrinsic_block_size_(value: String) -> Style
pub fn contain_intrinsic_height(value: Size) -> Style
pub fn contain_intrinsic_height_(value: String) -> Style
pub fn contain_intrinsic_inline_size(value: Size) -> Style
pub fn contain_intrinsic_inline_size_(value: String) -> Style
pub fn contain_intrinsic_size(value: Size) -> Style
pub fn contain_intrinsic_size_(value: String) -> Style
pub fn contain_intrinsic_width(value: Size) -> Style
pub fn contain_intrinsic_width_(value: String) -> Style
pub fn container_name(value: String) -> Style
pub fn container_type(value: String) -> Style
pub fn counter_increment(value: String) -> Style
pub fn counter_reset(value: String) -> Style
pub fn counter_set(value: String) -> Style
pub fn empty_cells(empty_cells: String) -> Style
pub fn field_sizing(field_sizing: String) -> Style
pub fn first_child(styles: List(Style)) -> Style
pub fn first_of_type(styles: List(Style)) -> Style
pub fn flex_basis(flex_basis: String) -> Style
pub fn flex_direction(flex_direction: String) -> Style
pub fn flex_grow_(flex_grow: String) -> Style
pub fn flex_shrink(flex_shrink: Float) -> Style
pub fn flex_shrink_(flex_shrink: String) -> Style
pub fn focus_visible(styles: List(Style)) -> Style
pub fn focus_within(styles: List(Style)) -> Style
pub fn font_family(font_family: String) -> Style
pub fn font_feature_settings(value: String) -> Style
pub fn font_kerning(value: String) -> Style
pub fn font_language_override(value: String) -> Style
pub fn font_optical_sizing(value: String) -> Style
pub fn font_palette(value: String) -> Style
pub fn font_size_(font_size: String) -> Style
pub fn font_size_adjust(value: String) -> Style
pub fn font_stretch(value: String) -> Style
pub fn font_style(font_style: String) -> Style
pub fn font_synthesis(value: String) -> Style
pub fn font_synthesis_position(value: String) -> Style
pub fn font_synthesis_small_caps(value: String) -> Style
pub fn font_synthesis_style(value: String) -> Style
pub fn font_synthesis_weight(value: String) -> Style
pub fn font_variant(value: String) -> Style
pub fn font_variant_alternates(value: String) -> Style
pub fn font_variant_caps(value: String) -> Style
pub fn font_variant_east_asian(value: String) -> Style
pub fn font_variant_emoji(value: String) -> Style
pub fn font_variant_ligatures(value: String) -> Style
pub fn font_variant_numeric(value: String) -> Style
pub fn font_variant_position(value: String) -> Style
pub fn font_variation_settings(value: String) -> Style
pub fn font_weight(font_weight: String) -> Style
pub fn forced_color_adjust(value: String) -> Style
pub fn grid_auto_columns(grid_auto_columns: String) -> Style
pub fn grid_auto_flow(grid_auto_flow: String) -> Style
pub fn grid_auto_rows(grid_auto_rows: String) -> Style
pub fn grid_column(grid_column: String) -> Style
pub fn grid_column_end(grid_column: String) -> Style
pub fn grid_column_start(grid_column: String) -> Style
pub fn grid_row_end(grid_row: String) -> Style
pub fn grid_row_start(grid_row: String) -> Style
pub fn grid_template(grid_template: String) -> Style
pub fn grid_template_areas(
grid_template_areas: List(String),
) -> Style
pub fn grid_template_columns(
grid_template_columns: String,
) -> Style
pub fn grid_template_rows(grid_template_rows: String) -> Style
pub fn hanging_punctuation(value: String) -> Style
pub fn hyphenate_character(value: String) -> Style
pub fn hyphenate_limit_chars(value: String) -> Style
pub fn image_orientation(value: String) -> Style
pub fn image_rendering(value: String) -> Style
pub fn important(style: Style) -> Style
Add an !important
flag to any CSS property.
It won’t have any effect on non-property style, like media, etc. It will
then act as the identity
function.
pub fn inline_size(value: String) -> Style
pub fn inset_area(value: String) -> Style
pub fn inset_block(value: String) -> Style
pub fn inset_block_end(value: String) -> Style
pub fn inset_block_start(value: String) -> Style
pub fn inset_inline(value: String) -> Style
pub fn inset_inline_end(value: String) -> Style
pub fn inset_inline_start(value: String) -> Style
pub fn justify_content(justify: String) -> Style
pub fn justify_items(justify: String) -> Style
pub fn justify_self(justify: String) -> Style
pub fn justify_tracks(justify: String) -> Style
pub fn last_child(styles: List(Style)) -> Style
pub fn last_of_type(styles: List(Style)) -> Style
pub fn letter_spacing(letter_spacing: String) -> Style
pub fn line_break(line_break: String) -> Style
pub fn line_height(line_height: String) -> Style
pub fn list_style(list_style: String) -> Style
pub fn list_style_image(list_style_image: String) -> Style
pub fn list_style_position(list_style_position: String) -> Style
pub fn list_style_type(list_style_type: String) -> Style
pub fn margin_block(margin: Size) -> Style
pub fn margin_block_(margin: String) -> Style
pub fn margin_block_end(margin: Size) -> Style
pub fn margin_block_end_(margin: String) -> Style
pub fn margin_block_start(margin: Size) -> Style
pub fn margin_block_start_(margin: String) -> Style
pub fn margin_bottom(margin: Size) -> Style
pub fn margin_bottom_(margin: String) -> Style
pub fn margin_inline(margin: Size) -> Style
pub fn margin_inline_(margin: String) -> Style
pub fn margin_inline_end(margin: Size) -> Style
pub fn margin_inline_end_(margin: String) -> Style
pub fn margin_inline_start(margin: Size) -> Style
pub fn margin_inline_start_(margin: String) -> Style
pub fn margin_left(margin: Size) -> Style
pub fn margin_left_(margin: String) -> Style
pub fn margin_right(margin: Size) -> Style
pub fn margin_right_(margin: String) -> Style
pub fn margin_top(margin: Size) -> Style
pub fn margin_top_(margin: String) -> Style
pub fn mask_border(value: String) -> Style
pub fn mask_border_mode(value: String) -> Style
pub fn mask_border_outset(value: String) -> Style
pub fn mask_border_repeat(value: String) -> Style
pub fn mask_border_slice(value: String) -> Style
pub fn mask_border_source(value: String) -> Style
pub fn mask_border_width(value: String) -> Style
pub fn mask_composite(value: String) -> Style
pub fn mask_image(value: String) -> Style
pub fn mask_origin(value: String) -> Style
pub fn mask_position(value: String) -> Style
pub fn mask_repeat(value: String) -> Style
pub fn math_depth(value: String) -> Style
pub fn math_style(value: String) -> Style
pub fn max_block_size(value: Size) -> Style
pub fn max_block_size_(value: String) -> Style
pub fn max_height(height: Size) -> Style
pub fn max_height_(height: String) -> Style
pub fn max_inline_size(value: Size) -> Style
pub fn max_inline_size_(value: String) -> Style
pub fn max_width_(width: String) -> Style
pub fn min_block_size(value: Size) -> Style
pub fn min_block_size_(value: String) -> Style
pub fn min_height(height: Size) -> Style
pub fn min_height_(height: String) -> Style
pub fn min_inline_size(value: Size) -> Style
pub fn min_inline_size_(value: String) -> Style
pub fn min_width_(width: String) -> Style
pub fn mix_blend_mode(value: String) -> Style
pub fn nth_last_child(
selector: String,
styles: List(Style),
) -> Style
pub fn nth_last_of_type(
selector: String,
styles: List(Style),
) -> Style
pub fn nth_of_type(
selector: String,
styles: List(Style),
) -> Style
pub fn object_fit(object_fit: String) -> Style
pub fn object_position(object_position: String) -> Style
pub fn offset_anchor(offset_anchor: String) -> Style
pub fn offset_distance(offset_distance: String) -> Style
pub fn offset_path(offset_path: String) -> Style
pub fn offset_position(offset_position: String) -> Style
pub fn offset_rotate(offset_rotate: String) -> Style
pub fn only_child(styles: List(Style)) -> Style
pub fn only_of_type(styles: List(Style)) -> Style
pub fn outline_color(outline_color: String) -> Style
pub fn outline_offset(outline_offset: String) -> Style
pub fn outline_style(outline_style: String) -> Style
pub fn outline_width(outline_width: String) -> Style
pub fn overflow_anchor(overflow_anchor: String) -> Style
pub fn overflow_block(overflow_block: String) -> Style
pub fn overflow_clip_margin(
overflow_clip_margin: String,
) -> Style
pub fn overflow_inline(overflow_inline: String) -> Style
pub fn overflow_wrap(overflow_wrap: String) -> Style
pub fn overflow_x(overflow_x: String) -> Style
pub fn overflow_y(overflow_y: String) -> Style
pub fn overscroll_behavior(value: String) -> Style
pub fn overscroll_behavior_block(value: String) -> Style
pub fn overscroll_behavior_inline(value: String) -> Style
pub fn overscroll_behavior_x(value: String) -> Style
pub fn overscroll_behavior_y(value: String) -> Style
pub fn padding_block(padding: Size) -> Style
pub fn padding_block_(padding: String) -> Style
pub fn padding_block_end(padding: Size) -> Style
pub fn padding_block_end_(padding: String) -> Style
pub fn padding_block_start(padding: Size) -> Style
pub fn padding_block_start_(padding: String) -> Style
pub fn padding_bottom(padding: Size) -> Style
pub fn padding_inline(padding: Size) -> Style
pub fn padding_inline_(padding: String) -> Style
pub fn padding_inline_end(padding: Size) -> Style
pub fn padding_inline_end_(padding: String) -> Style
pub fn padding_inline_start(padding: Size) -> Style
pub fn padding_inline_start_(padding: String) -> Style
pub fn padding_left(padding: Size) -> Style
pub fn padding_right(padding: Size) -> Style
pub fn padding_top(padding: Size) -> Style
pub fn page_break_after(value: String) -> Style
pub fn page_break_before(value: String) -> Style
pub fn page_break_inside(value: String) -> Style
pub fn paint_order(value: String) -> Style
pub fn perspective(value: String) -> Style
pub fn perspective_origin(value: String) -> Style
pub fn place_content(place: String) -> Style
pub fn place_items(place: String) -> Style
pub fn place_self(place: String) -> Style
pub fn placeholder(styles: List(Style)) -> Style
pub fn pointer_events(pointer_events: String) -> Style
pub fn print_color_adjust(print: String) -> Style
pub fn pseudo_selector(
value: String,
styles: List(Style),
) -> Style
pub fn read_write(styles: List(Style)) -> Style
pub fn render(cache: Cache) -> String
Render the content in the cache in proper CSS stylesheet.
pub fn ruby_position(value: String) -> Style
pub fn scroll_behavior(value: String) -> Style
pub fn scroll_margin(value: Size) -> Style
pub fn scroll_margin_(value: String) -> Style
pub fn scroll_margin_block(value: Size) -> Style
pub fn scroll_margin_block_(value: String) -> Style
pub fn scroll_margin_block_end(value: Size) -> Style
pub fn scroll_margin_block_end_(value: String) -> Style
pub fn scroll_margin_block_start(value: Size) -> Style
pub fn scroll_margin_block_start_(value: String) -> Style
pub fn scroll_margin_bottom(value: Size) -> Style
pub fn scroll_margin_bottom_(value: String) -> Style
pub fn scroll_margin_inline(value: Size) -> Style
pub fn scroll_margin_inline_(value: String) -> Style
pub fn scroll_margin_inline_end(value: Size) -> Style
pub fn scroll_margin_inline_end_(value: String) -> Style
pub fn scroll_margin_inline_start(value: Size) -> Style
pub fn scroll_margin_inline_start_(value: String) -> Style
pub fn scroll_margin_left(value: Size) -> Style
pub fn scroll_margin_left_(value: String) -> Style
pub fn scroll_margin_right(value: Size) -> Style
pub fn scroll_margin_right_(value: String) -> Style
pub fn scroll_margin_top(value: Size) -> Style
pub fn scroll_margin_top_(value: String) -> Style
pub fn scroll_padding(value: Size) -> Style
pub fn scroll_padding_(value: String) -> Style
pub fn scroll_padding_block(value: Size) -> Style
pub fn scroll_padding_block_(value: String) -> Style
pub fn scroll_padding_block_end(value: Size) -> Style
pub fn scroll_padding_block_end_(value: String) -> Style
pub fn scroll_padding_block_start(value: Size) -> Style
pub fn scroll_padding_block_start_(value: String) -> Style
pub fn scroll_padding_bottom(value: Size) -> Style
pub fn scroll_padding_bottom_(value: String) -> Style
pub fn scroll_padding_inline(value: Size) -> Style
pub fn scroll_padding_inline_(value: String) -> Style
pub fn scroll_padding_inline_end(value: Size) -> Style
pub fn scroll_padding_inline_end_(value: String) -> Style
pub fn scroll_padding_inline_start(value: Size) -> Style
pub fn scroll_padding_inline_start_(value: String) -> Style
pub fn scroll_padding_left(value: Size) -> Style
pub fn scroll_padding_left_(value: String) -> Style
pub fn scroll_padding_right(value: Size) -> Style
pub fn scroll_padding_right_(value: String) -> Style
pub fn scroll_padding_top(value: Size) -> Style
pub fn scroll_padding_top_(value: String) -> Style
pub fn scroll_snap_align(value: String) -> Style
pub fn scroll_snap_stop(value: String) -> Style
pub fn scroll_snap_type(value: String) -> Style
pub fn scrollbar_color(value: String) -> Style
pub fn scrollbar_gutter(value: String) -> Style
pub fn scrollbar_width(value: String) -> Style
pub fn shape_image_threshold(value: Float) -> Style
pub fn shape_image_threshold_(value: String) -> Style
pub fn shape_margin(value: Size) -> Style
pub fn shape_margin_(value: String) -> Style
pub fn shape_outside(value: String) -> Style
pub fn table_layout(layout: String) -> Style
pub fn text_align(text_align: String) -> Style
pub fn text_align_last(value: String) -> Style
pub fn text_combine_upright(value: String) -> Style
pub fn text_decoration(text_decoration: String) -> Style
pub fn text_decoration_color(value: String) -> Style
pub fn text_decoration_line(value: String) -> Style
pub fn text_decoration_skip_ink(value: String) -> Style
pub fn text_decoration_style(value: String) -> Style
pub fn text_decoration_thickness(value: String) -> Style
pub fn text_emphasis(value: String) -> Style
pub fn text_emphasis_color(value: String) -> Style
pub fn text_emphasis_position(value: String) -> Style
pub fn text_emphasis_style(value: String) -> Style
pub fn text_indent(value: String) -> Style
pub fn text_justify(text_justify: String) -> Style
pub fn text_orientation(value: String) -> Style
pub fn text_overflow(text_overflow: String) -> Style
pub fn text_rendering(value: String) -> Style
pub fn text_shadow(value: String) -> Style
pub fn text_transform(text_transform: String) -> Style
pub fn text_underline_offset(value: Size) -> Style
pub fn text_underline_offset_(value: String) -> Style
pub fn text_underline_position(value: String) -> Style
pub fn text_wrap_mode(value: String) -> Style
pub fn text_wrap_style(value: String) -> Style
pub fn touch_action(value: String) -> Style
pub fn transform(transform: String) -> Style
transform
will be turned into transform_
in 4.0.0
pub fn transform_(transform_args: List(Transform)) -> Style
transform_
uses sketch.transform
to offer an enhanced API for CSS transforms
pub fn transform_box(transform_box: String) -> Style
pub fn transform_origin(transform_origin: String) -> Style
pub fn transform_style(transform_style: String) -> Style
pub fn transition(transition: String) -> Style
pub fn transition_behavior(value: String) -> Style
pub fn transition_delay(value: String) -> Style
pub fn transition_duration(value: String) -> Style
pub fn transition_property(value: String) -> Style
pub fn transition_timing_function(value: String) -> Style
pub fn unicode_bidi(value: String) -> Style
pub fn user_select(user_select: String) -> Style
pub fn vertical_align(value: String) -> Style
pub fn visibility(visibility: String) -> Style
pub fn white_space(white_space: String) -> Style
pub fn white_space_collapse(
white_space_collapse: String,
) -> Style
pub fn will_change(value: String) -> Style
pub fn word_break(word_break: String) -> Style
pub fn word_spacing(word_spacing: String) -> Style
pub fn writing_mode(value: String) -> Style