Example #1
0
        protected override void BuildAttributeSet(AttributeSetBuilder builder)
        {
            base.BuildAttributeSet(builder);

            builder.AddAttribute("role", "progressbar");
            builder.AddAriaAttribute("busy", "true");

            builder.AddClassAttribute("lx-skeleton", Shape switch
            {
                SkeletonShape.Rectangle => "lx-skeleton-rect",
                SkeletonShape.Ellipsis => "lx-skeleton-ellipsis",
                SkeletonShape.Pill => "lx-skeleton-pill",
                _ => "lx-skeleton-text", // default
            });
Example #2
0
        protected override void BuildAttributeSet(AttributeSetBuilder builder)
        {
            builder.AddAttribute("role", "img");
            builder.AddAriaAttribute("hidden", "true");
            builder.AddClassAttribute(ClassName);

            builder.AddStyleAttribute(x => x
                                      .AddProperty("height", Size.ToString())
                                      .AddProperty("min-height", Size.ToString())
                                      .AddProperty("width", Size.ToString())
                                      .AddProperty("min-width", Size.ToString())
                                      .AddProperty("fill", Fill.IsEmpty ? _fillColor.ToRgbStr() : Fill.ToRgbaStr(), _isSourceResource)
                                      .AddProperty("color", Fill.IsEmpty ? _fillColor.ToRgbStr() : Fill.ToRgbaStr(), _isSourceResource));
        }