More Gotchas Getting Inline SVG Into Production—Part II

Post pobrano z: More Gotchas Getting Inline SVG Into Production—Part II

The following is a guest post by Rob Levin and Chris Rumble. Rob and Chris both work on the product design team at Mavenlink. Rob is also creator and host of the SVG Immersion Podcast and wrote the original 5 Gotchas article back in ’14. Chris, is a UI and Motion Designer/Developer based out of San Francisco. In this article, they go over some additional issues they encountered after incorporating inline SVGs in to Mavenlink’s flagship application more then 2 years ago. The article illustrations were done by Rob and—in the spirit of our topic—are 100% vector SVGs!

Explorations in Debugging

Wow, it’s been over 2 years since we posted the 5 Gotchas Getting SVG Into Production article. Well, we’ve encountered some new gotchas making it time for another follow up post! We’ll label these 6-10 paying homage to the first 5 gotchas in the original post 🙂

Gotcha Six: IE Drag & Drop SVG Disappears

SVG Disappears After Drag and Drop in IE

If you take a look at the animated GIF above, you’ll notice that I have a dropdown of task icons on the left, I attempt to drag the row outside of the sortable’s container element, and then, when I drop the row back, the SVG icons have completely disappeared. This insidious bug didn’t seem to happen on Windows 7 IE11 in my tests, but, did happen in Windows 10’s IE11! Although, in our example, the issue is happening due to use of a combination of jQuery UI Sortable and the nestedSortable plugin (which needs to be able to drag items off the container to achieve the nesting, any sort of detaching of DOM elements and/or moving them in the DOM, etc., could result in this disappearing behavior. Oddly, I wasn’t able to find a Microsoft ticket at time of writing, but, if you have access to a Windows 10 / IE11 setup, you can see for yourself how this will happen in this simple pen which was forked from fergaldoyle. The Pen shows the same essential disappearing behavior happening, but, this time it’s caused by simply moving an element containing an SVG icon via JavaScript’s appendChild.

A solution to this is to reset the href.baseVal attribute on all <use> elements that descend from event.target container element when a callback is called. For example, in the case of using Sortable, we were able to call the following method from inside Sortable’s stop callback:

function ie11SortableShim(uiItem) {
  function shimUse(i, useElement) {
    if (useElement.href && useElement.href.baseVal) {
      // this triggers fixing of href for IE
      useElement.href.baseVal = useElement.href.baseVal;
    }
  }

  if (isIE11()) {
    $(uiItem).find('use').each(shimUse);
  }
};

I’ve left out the isIE11 implementation, as it can be done a number of ways (sadly, most reliably through sniffing the window.navigator.userAgent string and matching a regex). But, the general idea is, find all the <use> elements in your container element, and then reassign their href.baseVal to trigger to IE to re-fetch those external xlink:href’s. Now, you may have an entire row of complex nested sub-views and may need to go with a more brute force approach. In my case, I also needed to do:

$(uiItem).hide().show(0);

to rerender the row. Your mileage may vary 😉

If you’re experiencing this outside of Sortable, you likely just need to hook into some „after” event on whatever the parent/container element is, and then do the same sort of thing.

As I’m boggled by this IE11 specific issue, I’d love to hear if you’ve encountered this issue yourself, have any alternate solutions and/or greater understanding of the root IE issues, so do leave a comment if so.

Gotcha Seven: IE Performance Boosts Replacing SVG4Everybody with Ajax Strategy

Performance Issues

In the original article, we recommended using SVG4Everybody as a means of shimming IE versions that don’t support using an external SVG definitions file and then referencing via the xlink:href attribute. But, it turns out to be problematic for performance to do so, and probably more kludgy as well, since it’s based off user agent sniffing regex. A more „straight forward” approach, is to use Ajax to pull in the SVG sprite. Here’s a slice of our code that does this which is, essentially, the same as what you’ll find in the linked article:

  loadSprite = null;

  (function() {
    var loading = false;
    return loadSprite = function(path) {
      if (loading) {
        return;
      }
      return document.addEventListener('DOMContentLoaded', function(event) {
        var xhr;
        loading = true;
        xhr = new XMLHttpRequest();
        xhr.open('GET', path, true);
        xhr.responseType = 'document';
        xhr.onload = function(event) {
          var el, style;
          el = xhr.responseXML.documentElement;
          style = el.style;
          style.display = 'none';
          return document.body.insertBefore(el, document.body.childNodes[0]);
        };
        return xhr.send();
      });
    };
  })();

  module.exports = {
    loadSprite: loadSprite,
  };

The interesting part about all this for us, was that—on our icon-heavy pages—we went from ~15 seconds down to ~1-2 seconds (for first uncached page hit) in IE11.

Something to consider about using the Ajax approach, you’ll need to potentially deal with a „flash of no SVG” until the HTTP request is resolved. But, in cases where you already have a heavy initial loading SPA style application that throws up a spinner or progress indicator, that might be a sunk cost. Alternatively, you may wish to just go ahead and inline your SVG definition/sprite and take the cache hit for better-percieved performance. If so, measure just how much you’re increasing the payload.

Gotcha Eight: Designing Non-Scaling Stroke Icons

In cases where you want to have various sizes of the same icon, you may want to lock down the stroke sizes of those icons…

Why, what’s the issue?

Strokes VS Fills

Imagine you have a height: 10px; width: 10px; icon with some 1px shapes and scale it to 15px. Those 1px shapes will now be 1.5px which ends up creating a soft or fuzzy icon due to borders being displayed on sub-pixel boundaries. This softness also depends on what you scale to, as that will have a bearing on whether your icons are on sub-pixel boundaries. Generally, it’s best to control the sharpness of your icons rather than leaving them up to the will of the viewer’s browser.

The other problem is more of a visual weight issue. As you scale a standard icon using fills, it scales proportionately…I can hear you saying „SVG’s are supposed to that”. Yes, but being able to control the stroke of your icons can help them feel more related and seen as more of a family. I like to think of it like using a text typeface for titling, rather than a display or titling typeface, you can do it but why when you could have a tight and sharp UI.

Prepping the Icon

I primarily use Illustrator to create icons, but plenty of tools out there will work fine. This is just my workflow with one of those tools. I start creating an icon by focusing on what it needs to communicate not really anything technical. After I’m satisfied that it solves my visual needs I then start scaling and tweaking it to fit our technical needs. First, size and align your icon to the pixel grid (⌘⌥Y in Illustrator for pixel preview, on a Mac) at the size you are going to be using it. I try to keep diagonals on 45° and adjust any curves or odd shapes to keep them from getting weird. No formula exists for this, just get it as close as you can to something you like. Sometimes I scrap the whole idea if it’s not gonna work at the size I need and start from scratch. If it’s the best visual solution but no one can identify it… it’s not worth anything.

Exporting AI

I usually just use the Export As „SVG” option in Illustrator, I find it gives me a standard and minimal place to start. I use the Presentation Attributes setting and save it off. It will come out looking something like this:

<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18">
  <title>icon-task-stroke</title>
  <polyline points="5.5 1.5 0.5 1.5 0.5 4.5 0.5 17.5 17.5 17.5 17.5 1.5 12.5 1.5" fill="none" stroke="#b6b6b6" stroke-miterlimit="10"/>
  <rect x="5.5" y="0.5" width="7" height="4" fill="none" stroke="#b6b6b6" stroke-miterlimit="10"/>
  <line x1="3" y1="4.5" x2="0.5" y2="4.5" fill="none" stroke="#b6b6b6" stroke-miterlimit="10"/>
  <line x1="17.5" y1="4.5" x2="15" y2="4.5" fill="none" stroke="#b6b6b6" stroke-miterlimit="10"/>
  <polyline points="6 10 8 12 12 8" fill="none" stroke="#ffa800" stroke-miterlimit="10" stroke-width="1"/>
</svg>

I know you see a couple of 1/2 pixels in there! Seems like there are a few schools of thought on this. I prefer to have the stroke line up to the pixel grid as that is what will display in the end. The coordinates are placed on the 1/2 pixel so that your 1px stroke is 1/2 on each side of the path. It looks something like this (in Illustrator):

Strokes on the Pixel Grid

Gotcha Nine: Implementing Non-Scaling Stroke

Clean Up

Galactic Vacuum

Our Grunt task, which Rob talks about in the previous article, cleans up almost everything. Unfortunately for the non-scaling-stroke you have some hand-cleaning to do on the SVG, but I promise it is easy! Just add a class to the paths on which you want to restrict stroke scaling. Then, in your CSS add a class and apply the attribute vector-effect: non-scaling-stroke; which should look something like this:

.non-scaling-stroke {
  vector-effect: non-scaling-stroke;
}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18">
  <title>icon-task-stroke</title>
  <polyline class="non-scaling-stroke" points="5.5 1.5 0.5 1.5 0.5 4.5 0.5 17.5 17.5 17.5 17.5 1.5 12.5 1.5" stroke="#b6b6b6" stroke-miterlimit="10"/>
  <rect class="non-scaling-stroke" x="5.5" y="0.5" width="7" height="4" stroke="#b6b6b6" stroke-miterlimit="10"/>
  <line class="non-scaling-stroke" x1="3" y1="4.5" x2="0.5" y2="4.5" stroke="#b6b6b6" stroke-miterlimit="10"/>
  <line class="non-scaling-stroke" x1="17.5" y1="4.5" x2="15" y2="4.5" stroke="#b6b6b6" stroke-miterlimit="10"/>
  <polyline class="non-scaling-stroke" stroke="currentcolor" points="6 10 8 12 12 8" stroke="#ffa800" stroke-miterlimit="10" stroke-width="1"/>
</svg>

This keeps the strokes, if specified, from changing (in other words, the strokes will remain at 1px even if the overall SVG is scaled) when the SVG is scaled. We also add fill: none; to a class in our CSS script where we also control the stroke color as they will fill with #000000 by default.That’s it! Now, you have beautiful pixel adherent strokes that will maintain stroke width!

And after all is said and done (and you have preprocessed via grunt-svgstore per the first article), your SVG will look like this in the defs file:

<svg>
  <symbol viewBox="0 0 18 18" id="icon-task-stroke">
    <title>icon-task-stroke</title>
    <path class="non-scaling-stroke" stroke-miterlimit="10" d="M5.5 1.5h-5v16h17v-16h-5"/>
    <path class="non-scaling-stroke" stroke-miterlimit="10" d="M5.5.5h7v4h-7zM3 4.5H.5M17.5 4.5H15"/>
    <path class="non-scaling-stroke" stroke="currentColor" stroke-miterlimit="10" d="M6 10l2 2 4-4"/>
  </symbol>
</svg>

CodePen Example

The icon set on the left is scaling proportionately, and on the right, we are using the vector-effect: non-scaling-stroke;. If your noticing that your resized SVG icon’s strokes are starting to look out of control, the above technique will give you the ability to lock those babies down.

See the Pen SVG Icons: Non-Scaling Stroke by Chris Rumble (@Rumbleish) on CodePen.

Gotcha Ten: Accessibility

Accessible planet illustration

With everything involved in getting your SVG icon system up-and-running, it’s easy to overlook accessibility. That’s a shame, because SVGs are inherently accessible, especially if compared to icon fonts which are known to not always play well with screen readers. At bare minimum, we need to sprinkle a bit of code to prevent any text embedded within our SVG icons from being announced by screen readers. Although we’d love to just add a <title> tag with alternative text and „call it a day”, the folks at Simply Accessible have found that Firefox and NVDA will not, in fact, announce the <title> text.

Their recommendation is to apply the aria-hidden="true" attribute to the <svg> itself, and then add an adjacent span element with a .visuallyhidden class. The CSS for that visually hidden element will be hidden visually, but its text will available to the screen reader to announce. I’m bummed that it doesn’t feel very semantic, but it may be a reasonable comprimise while support for the more intuitively reasonable <title> tag (and combinations of friends like role, aria-labelledby, etc.) work across both browser and screen reader implementations. To my mind, the aria-hidden on the SVG may be the biggest win, as we wouldn’t want to inadvertantly set off the screen reader for, say, 50 icons on a page!

Here’s the general patterns borrowed but alterned a bit from Simply Accessible’s pen:

<a href="/somewhere/foo.html">
    <svg class="icon icon-close" viewBox="0 0 32 32" aria-hidden="true">
        <use xlink:href="#icon-close"></use>
    </svg>
    <span class="visuallyhidden">Close</span>
</a>

As stated before, the two things interesting here are:

  1. aria-hidden attribute applied to prevent screen readers from announcing any text embedded within the SVG.
  2. The nasty but useful visuallyhidden span which WILL be announced by screen reader.

Honestly, if you would rather just code this with the <title> tag et al approach, I wouldn’t necessarily argue with you as it this does feel kludgy. But, as I show you the code we’ve used that follows, you could see going with this solution as a version 1 implementation, and then making that switch quite easily when support is better…

Assuming you have some sort of centralized template helper or utils system for generating your use xlink:href fragments, it’s quite easy to implement the above. We do this in Coffeescript, but since JavaScript is more universal, here’s the code that gets resolved to:

  templateHelpers = {
    svgIcon: function(iconName, iconClasses, iconAltText) {
      var altTextElement = iconAltText ? "" + iconAltText + "" : '';
      var titleElement = iconTitle ? "<title>" + iconTitle + "</title>" : '';
      iconClasses = iconClasses ? " " + iconClasses : '';
      return this.safe.call(this, "<svg aria-hidden='true' class='icon-new " + iconClasses + "'><use xlink:href='#" + iconName + "'>" + titleElement + "</use></svg>" + altTextElement);
    },
    ...

Why are we putting the <title> tag as a child of <use> instead of the <svg>? According to Amelia Bellamy-Royds(Invited Expert developing SVG & ARIA specs @w3c. Author of SVG books from @oreillymedia), you will get tooltips in more browsers.

Here’s the CSS for .visuallyhidden. If you’re wondering why we’re doing it this particular why and not, say, display: none;, or other familiar means, see Chris Coyier’s article which explains this in depth:

.visuallyhidden {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    width: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    position: absolute;
}

This code is not meant to be used „copy pasta” style, as your system will likely have nuanced differences. But, it shows the general approach, and, the important bits are:

  • the iconAltText, which allows the caller to provide alternative text if it seems appropriate (e.g. the icon is not purely decorative)
  • the aria-hidden="true" which now, is always placed on the SVG element.
  • the .visuallyhidden class will hide the element visually, while still making the text in that element available for screen readers

As you can see, it’d be quite easy to later refactor this code to use the <title> approach usually recommended down the road, and at least the maintainence hit won’t be bad should we choose to do so. The relevant refactor changes would likely be similar to:

var aria = iconAltText ? 'role="img" aria-label="' + iconAltText + '"' : 'aria-hidden="true"';
return this.safe.call(this, "<svg " + aria + " class='icon-new " + iconClasses + "'><use xlink:href='#" + iconName + "'>" + titleElement + "</use></svg>");

So, in this version (credit to Amelia for the aria part!), if the caller passes alternative text in, we do NOT hide the SVG, and, we also do not use the visually hidden span technique, while adding the role and aria-label attributes to the SVG. This feels much cleaner, but the jury is out on whether screen readers are going to support this approach as well as using the visually hidden span technique. Maybe the experts (Amelia and Simply Accessible folks), will chime in on the comments 🙂

Bonus Gotcha: make viewBox width and height integers or scaling gets funky

If you have an SVG icon that you export with a resulting viewBox like: viewBox="0 0 100 86.81", you may have issues if you use transform: scale. For example, if your generally setting the width and height equal as is typical (e.g. 16px x 16px), you might expect that the SVG should just center itself in it’s containing box, especially if you’re using the defaults for preserveAspectRatio. But, if you attempt to scale it at all, you’ll start to notice clipping.

In the following Adobe Illustrator screen capture, you see that „Snap to Grid” and „Snap to Pixel” are both selected:

Align and Snap to Pixel Grid

The following pen shows the first three icons getting clipped. This particular icon (it’s defined as a <symbol> and then referenced using the xlink:href strategy we’ve already went over), has a viewBox with non-integer height of 86.81, and thus we see the clipping on the sides. The next 3 examples (icons 4-6), have integer width and heights (the third argument to viewBox is width and the fourth is height), and does not clip.

See the Pen SVG Icons: Scale Clip Test 2 by Rob Levin (@roblevin) on CodePen.

Conclusions

The above challenges are just some of the ones we’ve encountered at Mavenlink having had a comprehensive SVG icon system in our application for well over 2 years now. The mysterious nature of some of these is par for the course given our splintered world of various browsers, screen readers, and operating systems. But, perhaps these additional gotchas will help you and your team to better harden your SVG icon implementations!


More Gotchas Getting Inline SVG Into Production—Part II is a post from CSS-Tricks

Havaianas: Made of Brazilian Summer

Post pobrano z: Havaianas: Made of Brazilian Summer
Print
Havaianas

Havaianas are the best translation of Brazilian summer. To show that, we decided to transform Havaianas packaging into packaging for the best that summer in Brazil has to offer &ndash; joy, energy, rhythm, etc.

Advertising Agency:AlmapBBDO, São Paulo, Brazil
Partner:Luiz Sanches
Chief Creative Officer:Luiz Sanches
Creative Director:Bruno Prosperi, André Gola, Benjamin Yung Jr, Marcelo Nogueira, Pernil
Art Director:Keka Morelle, Felipe Antonioli
Copywriter:Pedro Corbett, Daniel Oksenberg
Illustrator:Adelmo Barreira, Motor Niveo, Black Madre Atelier, Gelmi Estudio De Arte
Photographer:Alê Catan, Mariana Valverde
Art Buyer:Teresa Setti, Ana Cecília Costa
Accounts Vice President:Cristina Chacon
Account Director:Flavia Fusco
Account Supervisor:Italo Vetorazzo
Account Executive:Sâmia Reiter
Planning Vice-President:Sergio Katz
Planning Director:Vanessa Sakamoto
Media Vice President:Luis Flavio Padilha

How to Create a Casino Text Effect in Adobe Illustrator

Post pobrano z: How to Create a Casino Text Effect in Adobe Illustrator

Final product image
What You’ll Be Creating

In the following steps you will learn how to create a casino text effect in Adobe Illustrator. For starters, you will learn how to set up a simple grid and how to create the main shapes using a free font and basic vector shape-building techniques. 

Taking full advantage of the Appearance panel, you will learn how to stylize shapes and compound paths. You will also learn how to save gradients and graphic styles and how to easily apply them later. 

Moving on, you will learn how to add subtle highlights using simple effects and basic blending techniques. Finally, you will learn how to add a subtle texture for the entire illustration.

For more inspiration on how to adjust or improve your final text effect, you can find plenty of resources at GraphicRiver.

1. How to Create a New Document and Set Up a Grid

Hit Control-N to create a New Document. Select Pixels from the Units drop-down menu, enter 850 in the Width box and 610 in the Height box, and then click that More Settings button. Select RGB for the Color Mode, set the Raster Effects to Screen (72 ppi) and then click the Create Document button.

Enable the Grid (View > Show Grid) and the Snap to Grid (View > Snap to Grid). You will need a grid every 5 px, so simply go to Edit > Preferences > Guides > Grid, and enter 5 in the Gridline every box and 1 in the Subdivisions box. Try not to get discouraged by all that grid—it will make your work easier, and keep in mind that you can easily enable or disable it using the Control-„ keyboard shortcut.

You can learn more about Illustrator’s grid system in this short tutorial from Andrei Stefan: Understanding Adobe Illustrator’s Grid System.

You should also open the Info panel (Window > Info) for a live preview with the size and position of your shapes. Don’t forget to set the unit of measurement to Pixels from Edit > Preferences > Units. All these options will significantly increase your work speed.

setup grid

2. How to Create the Background and Add Text

Step 1

Pick the Rectangle Tool (M) and focus on your toolbar. Remove the color from the Stroke and then select the Fill and set its color to R=42 G=47 B=66. Move to your artboard and simply create an 860 x 620 px rectangle—the grid and the Snap to Grid should make this easier.

Make sure that your rectangle stays selected and open the Align panel (Window > Align). Select Align to Artboard from that drop-down menu and then click the Horizontal Align Center and Vertical Align Center buttons to easily center your selection.

Move to the Layers panel (Window > Layers), select the existing layer, and simply Lock your shape to make sure that you don’t accidentally select/move it.

add a rectangle

Step 2

Pick the Type Tool (T) and open the Character panel (Window > Type > Character). Select the BudmoJiggler-Regular font, and set the Size to 150 px and the Tracking to 30. Add the „CASINO SLOTS” text, set the color to white, and center it.

type tool for text

3. How to Create the Main Shapes

Step 1

Make sure that your text stays selected and go to Type > Create Outlines (Shift-Control-O). Open the Pathfinder panel (Window > Pathfinder), click the Divide button, and then Ungroup your group using the Shift-Control-G keyboard shortcut.

create the main shapes

Step 2

Focus on the Layers panel, open the existing layer, and you should find a bunch of shapes that do not have a color set for Fill or Stroke (basically invisible). Select one of these shapes from the Layers panel and then go to Select > Same > Appearance to easily select all the shapes with identical Appearance attributes. Fill these shapes with a random blue.

select similar shapes

Step 3

Select the three shapes highlighted in the first image and remove them using the Delete key.

delete three shapes

Step 4

Select all those blue shapes and Group them (Control-G). Make sure that this new group is selected and add a Copy in Front (Control-C > Control-F). Select this group copy along with the white shapes and click the Unite button from the Pathfinder panel.

Ungroup (Shift-Control-G) the resulting white shapes. Move to the Layers panel, select the remaining group of blue shapes, and bring it to front (Shift-Control-]).

unite the white shapes

Step 5

Select the six white shapes that make up your top word and hit Control-8 (or go to Object > Compound Path > Make) to turn them into a compound path. Move to the bottom word, select the white shapes, and turn them into a second compound path.

create a compound path

4. How to Create and Use the First Graphic Style

Step 1

Make sure that your bottom compound path stays selected and focus on the Appearance panel (Window > Appearance). Select the Fill and simply replace the color with the Linear Gradient shown below.

add a linear gradient

Step 2

Make sure that your bottom compound path stays selected, keep focusing on the Appearance panel, and add a second Fill using the Add New Fill button.

Drag your new fill below the existing one, apply the Linear Gradient shown below, and then go to Effect > Path > Offset Path. Enter a 2 px Offset, set the Joins to Round, and click OK. Keep in mind that the blue numbers from the Gradient window stand for Location percentage. With this bottom fill still selected, go to Effect > Distort & Transform > Transform. Drag the Move-Vertical slider to 0.2 px, enter 60 in that Copies box, and then click the OK button.

transform the fill

Step 3

Make sure that your bottom compound path stays selected, keep focusing on the Appearance panel, and add a third Fill using that same Add New Fill button.

Drag your new fill below the existing ones, apply the Linear Gradient shown below, and then go to Effect > Path > Offset Path. Enter a 2 px Offset, set the Joins to Round, and click that OK button. Next, go to Effect > Distort & Transform > Transform. Drag the Move-Vertical slider to 13 px and then click OK.

With this bottom fill still selected, go to the Swatches panel (Window > Swatches), and click New Swatch to quickly save your yellow Linear Gradient.

save gradient

Step 4

Make sure that your bottom compound path stays selected, keep focusing on the Appearance panel, and add a fourth Fill.

Drag this new fill below the existing ones, set the color to R=24 G=27 B=36, and then go to Effect > Path > Offset Path. Enter a 2 px Offset, set the Joins to Round, and click that OK button. Next, go to Effect > Distort & Transform > Transform. Drag the Move-Vertical slider to 15 px, click OK, and then go to Effect > Stylize > Drop Shadow. Enter the attributes shown in the following image and then click OK.

add a drop shadow

Step 5

Make sure that your bottom compound path stays selected, keep focusing on the Appearance panel and add a fifth Fill.

Drag this new fill below the existing ones and set the color to black (R=0 G=0 B=0). Lower its Opacity to 15%, change the Blending Mode to Soft Light, and then go to Effect > Path > Offset Path. Enter a 7 px Offset, set the Joins to Round, and click OK. Next, go to Effect > Distort & Transform > Transform. Drag the Move-Vertical slider to 14 px and click OK.

add a black fill

Step 6

Make sure that your bottom compound path stays selected, keep focusing on the Appearance panel, and add a sixth Fill.

Drag this new fill below the existing ones and apply the linear gradient shown below. Lower its Opacity to 75%, change the Blending Mode to Soft Light, and keep in mind that the yellow zero stands for Opacity percentage. With this bottom fill still selected, go to Effect > Path > Offset Path. Enter a 2 px Offset, click the OK button, and then go to Effect > Distort & Transform > Transform. Drag the Move-Vertical slider to 50 px, click the OK button, and then go to Effect > Blur > Gaussian Blur. Enter an 8 px Radius and click OK.

add another linear gradient

Step 7

Make sure that your bottom compound path stays selected, keep focusing on the Appearance panel and select the existing Stroke. Set the color to R=35 G=31 B=32, lower its Opacity to 70%, change the Blending Mode to Soft Light, and then click that „Stroke” piece of text to open the Stroke fly-out panel. Set the Weight to 2 px and then check the Round Join and Align Stroke to Inside buttons.

add a black stroke

Step 8

Make sure that your bottom compound path stays selected, keep focusing on the Appearance panel and add a second Stroke using the Add New Stroke button.

Select this new stroke, apply your yellow Linear Gradient from the Swatches panel, and then open the Stroke fly-out panel. Set the Weight to 1 px and then check the Round Join and Align Stroke to Outside buttons.

stroke with a linear gradient

Step 9

Make sure that your bottom compound path is still selected, open the Graphic Styles panel (Window > Graphic Styles), and click New Graphic Style. Move to your top compound path, select it, and simply apply your graphic style from the Graphic Styles panel.

new graphic style

5. How to Create and Use the Second Graphic Style

Step 1

Reselect your group of blue circles and Ungroup it (Shift-Control-G). Focus on one of those blue circles, select it, and replace the blue with the Radial Gradient shown in the following image. Use the Gradient Tool (G) to adjust the size and position of your gradient as shown below.

add a radial gradient

Step 2

Make sure that your yellow circle stays selected and keep focusing on the Appearance panel. Select the Fill and Duplicate it using the Duplicate Selected Item button.

Select the newly added fill and go to Effect > Stylize > Drop Shadow. Enter the attributes shown in the left window (in the following image), click the OK button, and then go again to Effect > Stylize > Drop Shadow. Enter the attributes shown in the other window and then click OK.

duplicate selected item

Step 3

Make sure that your yellow circle stays selected and keep focusing on the Appearance panel. Select the bottom fill and go to Effect > Stylize > Outer Glow. Enter the attributes shown in the following image and then click OK.

add an outer glow

Step 4

Make sure that your yellow circle stays selected and keep focusing on the Appearance panel.

Select the stroke, set the color to R=35 G=31 B=32, and open the Stroke fly-out panel. Be sure that the Weight is set to 1 px and check the Align Stroke to Outside button. Lower its Opacity to 50% and change the Blending Mode to Soft Light and then go to Effect > Distort & Transform > Transform. Drag the Move-Vertical slider to 1 px and then click OK.

add a stroke

Step 5

Make sure that your yellow circle is still selected, go to the Graphic Styles panel, and save your second graphic style. Select all your blue circles and apply this second graphic style.

new graphic style

6. How to Add Subtle Highlights

Step 1

Using the Ellipse Tool (L), create a 10 px circle and fill it with white (R=255 G=255 B=255). Lower its Opacity to 80%, change the Blending Mode to Overlay, and then go to Effect > Distort & Transform > Pucker & Bloat. Drag that slider to -80% and then click that OK button. Multiply this tiny circle (Control-C > Control-F) and spread the copies as shown in the second image.

apply pucker bloat

Step 2

Using the Ellipse Tool (L), create an 80 px circle and place it roughly as shown in the first image. Fill it with the Radial Gradient shown below and focus on the Appearance panel. Don’t forget that the yellow zero from the Gradient image stands for Opacity percentage. Select the fill, change its Blending Mode to Overlay, and go to Effect > Blur > Gaussian Blur. Enter an 18 px Radius and then click OK.

apply gaussian blur

Step 3

Make sure that your fresh circle stays selected, keep focusing on the Appearance panel, and Duplicate the existing Fill. Select this new fill, lower its Opacity to 80%, and click the existing Gaussian Blur effect to open it. Lower the Radius to 9 px and then go to Effect > Path > Offset Path. Enter a -10 px Offset and then click OK.

apply more gaussian blur

Step 4

Make sure that your fresh circle stays selected, keep focusing on the Appearance panel, and Duplicate the top Fill. Select this new fill, lower its Opacity to 60%, and open the existing Gaussian Blur effect. Lower the Radius to 5 px and then open the existing Offset Path effect. Enter a -20 px Offset and then click OK.

Duplicate this circle and place the copy as shown in the second image.

apply gaussian blur to the circle

7. How to Add Shading and a Subtle Texture

Step 1

Using the Rectangle Tool (M), create a new 860 x 620 px shape, and center it. Fill it with the Radial Gradient shown below and change the Blending Mode to Soft Light. Remember that the yellow zero from the Gradient image stands for Opacity percentage, and use the Gradient Tool (G) to stretch your gradient roughly as shown in the following image.

dark radial gradient

Step 2

Make sure that your newest rectangle stays selected and keep focusing on the Appearance panel. Add a second Fill and select it. Set the color to black, lower its Opacity to 10%, and change the Blending Mode to Soft Light. Then go to Effect > Artistic > Film Grain. Enter the attributes shown in the following image and click OK.

film grain

Congratulations! You’re Done!

Here’s how it should look. I hope you’ve enjoyed this tutorial and can apply these techniques in your future projects.

Feel free to adjust the final design and make it your own. You can find some great sources of inspiration at GraphicRiver with interesting solutions to improve your design.

Casino Text Effect Adobe Ilustrator Tutorial