/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//! Generic values for UI properties.
usecrate::values::specified::ui::CursorKind; use std::fmt::{self, Write}; use style_traits::{CssWriter, ToCss};
/// A generic value for the `cursor` property. /// /// https://drafts.csswg.org/css-ui/#cursor #[derive(
Clone,
Debug,
MallocSizeOf,
PartialEq,
SpecifiedValueInfo,
ToComputedValue,
ToResolvedValue,
ToShmem,
)] #[repr(C)] pubstruct GenericCursor<Image> { /// The parsed images for the cursor. pub images: crate::OwnedSlice<Image>, /// The kind of the cursor [default | help | ...]. pub keyword: CursorKind,
}
impl<Image: ToCss> ToCss for Cursor<Image> { fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result where
W: Write,
{ for image in &*self.images {
image.to_css(dest)?;
dest.write_str(", ")?;
} self.keyword.to_css(dest)
}
}
/// A generic value for item of `image cursors`. #[derive(Clone, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToResolvedValue, ToShmem)] #[repr(C)] pubstruct GenericCursorImage<Image, Number> { /// The url to parse images from. pub image: Image, /// Whether the image has a hotspot or not. pub has_hotspot: bool, /// The x coordinate. pub hotspot_x: Number, /// The y coordinate. pub hotspot_y: Number,
}
/// A generic value for `scrollbar-color` property. /// /// https://drafts.csswg.org/css-scrollbars-1/#scrollbar-color #[derive(
Animate,
Clone,
ComputeSquaredDistance,
Copy,
Debug,
MallocSizeOf,
PartialEq,
SpecifiedValueInfo,
ToAnimatedValue,
ToAnimatedZero,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)] #[repr(C, u8)] pubenum GenericScrollbarColor<Color> { /// `auto`
Auto, /// `<color>{2}`
Colors { /// First `<color>`, for color of the scrollbar thumb.
thumb: Color, /// Second `<color>`, for color of the scrollbar track.
track: Color,
},
}
pubuseself::GenericScrollbarColor as ScrollbarColor;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.