Title: Invalid CSS if updating from older version
Last modified: October 28, 2019

---

# Invalid CSS if updating from older version

 *  [Arno Welzel](https://wordpress.org/support/users/awelzel/)
 * (@awelzel)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/invalid-css-3/)
 * The plugin creates invalid CSS if updated from an older version which did not
   have the option for “uppercase” letters yet:
 *     ```
       		.sgi-letter-avatar > span{
       				display:block;
       				text-transform: ;
       				font-size:32px;
   
       			}
       ```
   
 * The reason for this is lib/ltav-frontend.php, line 240-255:
 *     ```
       		$css .= sprintf(
       			".sgi-letter-avatar{
       				text-align:center;
       				%s
       			}
       			.sgi-letter-avatar > span{
       				display:block;
       				text-transform: %s;
       				font-size:%spx;
       				%s
       			}",
       			$shape,
       			$style_opts['case'],
       			$font_opts['font_size'],
       			$gfont
       		);
       ```
   
 * If one updated the plugin from an earlier version, the array element `$style_opts['
   case']` can be an empty string since the setting for “case” does not exist yet!
   In this case, no text-transform is output at all.
 * Workaround: add a default value for `$style_opts['case']`:
 *     ```
       		if ($style_opts['case'] == '') {
       			$style_opts['case'] = 'uppercase';
       		}
   
       		$css .= sprintf(
       			".sgi-letter-avatar{
       				text-align:center;
       				%s
       			}
       			.sgi-letter-avatar > span{
       				display:block;
       				text-transform: %s;
       				font-size:%spx;
       				%s
       			}",
       			$shape,
       			$style_opts['case'],
       			$font_opts['font_size'],
       			$gfont
       		);
       ```
   
    -  This topic was modified 6 years, 7 months ago by [Arno Welzel](https://wordpress.org/support/users/awelzel/).

Viewing 1 replies (of 1 total)

 *  Plugin Author [Sibin Grasic](https://wordpress.org/support/users/seebeen/)
 * (@seebeen)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/invalid-css-3/#post-12469116)
 * Fixed in version 3.0 🙂

Viewing 1 replies (of 1 total)

The topic ‘Invalid CSS if updating from older version’ is closed to new replies.

 * ![](https://ps.w.org/letter-avatars/assets/icon-256x256.png?rev=1320502)
 * [Letter Avatars](https://wordpress.org/plugins/letter-avatars/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/letter-avatars/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/letter-avatars/)
 * [Active Topics](https://wordpress.org/support/plugin/letter-avatars/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/letter-avatars/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/letter-avatars/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [Sibin Grasic](https://wordpress.org/support/users/seebeen/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/invalid-css-3/#post-12469116)
 * Status: not resolved