10.1 C
Canberra
Tuesday, July 22, 2025

html – Methods to use variable throughout the linear-gradient property of border-image on iOS 16.2


It would not work in iOS 16.2, but it surely’s works in iOS 17.4.1

I am testing animation utilizing linear-gradient for border-image.

I’ve checked that the majority browsers on Home windows are working correctly.

However after I checked it on my iPhone, gradient isn’t represented.

Is there a method to make use of variables?

If that model would not help it, I will strive one other method.

I would respect it in case you might give me a solution.

Code

The iPhone’s browser doesn’t specific the gradient when utilizing variables.

* {
  box-sizing: border-box;
}

html, physique {
  margin: 0;
}

@property --angle {
  syntax: "";
  inherits: true;
  initial-value: 0deg;
}

.wrap {
  show: flex;
}

.border-animation {
  place: relative;
  width: 300px;
  peak: 300px;
  border: 10px strong #fff;
  border-image: linear-gradient(var(--angle), crimson 0%, blue 100%);
  border-image-slice: 1;
  animation: autoRotate 1s infinite;
  margin-right: 20px;
}

.border-animation-without-variable {
  place: relative;
  width: 300px;
  peak: 300px;
  border: 10px strong #fff;
  border-image: linear-gradient(0deg, crimson 0%, blue 100%);
  border-image-slice: 1;
  animation: autoRotate 1s infinite;
}

@keyframes autoRotate {
  to {
      --angle: 360deg;
  }
}



  
  
  Doc
  


  

With variable

With out variable

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

[td_block_social_counter facebook="tagdiv" twitter="tagdivofficial" youtube="tagdiv" style="style8 td-social-boxed td-social-font-icons" tdc_css="eyJhbGwiOnsibWFyZ2luLWJvdHRvbSI6IjM4IiwiZGlzcGxheSI6IiJ9LCJwb3J0cmFpdCI6eyJtYXJnaW4tYm90dG9tIjoiMzAiLCJkaXNwbGF5IjoiIn0sInBvcnRyYWl0X21heF93aWR0aCI6MTAxOCwicG9ydHJhaXRfbWluX3dpZHRoIjo3Njh9" custom_title="Stay Connected" block_template_id="td_block_template_8" f_header_font_family="712" f_header_font_transform="uppercase" f_header_font_weight="500" f_header_font_size="17" border_color="#dd3333"]
- Advertisement -spot_img

Latest Articles