Jump to content

tcp13

Circle Member
  • Posts

    388
  • Joined

  • Last visited

  • Days Won

    6

Posts posted by tcp13

  1. @mirandakelton,

    You may need to wrap it in document ready:

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
    
    <script>
      $(document).ready(function(){
        $(".Mobile-bar-menu").attr("aria-label", "toggle mobile navigation menu");
        $(".Header-search-form-submit").attr("aria-label", "search");
      });
    </script>

    Otherwise, I'm not quite sure from here.

  2. 9 hours ago, mirandakelton said:

    I have "no accessible name" popping up for my search icon

    Try this:

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
    
    <script>
      $(".Mobile-bar-menu").attr("aria-label", "toggle mobile navigation menu");
      $(".Header-search-form-submit").attr("aria-label", "search");
    </script>

     

  3. Hey @simon.stjohn,

    Instead of pasting your code into the Custom CSS area (which applies it sitewide to every page), open up the page settings (cogwheel icon). Under "Advanced", you can paste the code into the Page Header Code Injection which only applies to that page.

    image.png.fd6a62523b2423125f8ed9c334e4b332.png

    This injection expects HTML, so if you're pasting in CSS, you'll need to wrap it in <style> tags like so:

    <style>
      /* PASTE YOUR CSS CODE HERE */
    </style>

    Hope this helps!
    -Tyler

  4. On 4/15/2022 at 2:00 PM, HG-Design said:

    the padding I am trying to reduce is from the image to the first line of text as per the attachment. 

    Ah. Try this then:

    .page-section[data-section-id="625726cc3a16c8026eec4ae7"] .content-wrapper {
      padding-bottom: 0px !important;
    }

    Otherwise, you can try cropping the image. The remaining space is just transparency from the png.

  5. On 4/14/2022 at 2:40 AM, HG-Design said:

    there is still quite bit of padding above the image on the store (products gallery) page. Is there a way to reduce this slightly? 

    image.thumb.png.da65023b7b7d4aedec0121f5f1945cdd.png

    Looks pretty good as is on my screen, but you could tweak it further with this code:

    .page-section[data-section-id="625726cc3a16c8026eec4ae7"] {
      padding-top: 70px !important;
    }
    

    Hope this helps!
    -Tyler

  6. Hi @HG-Design,

    You have an empty product navigation bar that's taking up some extra space on all your store pages. You can remove it by adding the following CSS from Design > Custom CSS:

    .ProductItem-nav {
      display: none !important;
    }

    If needed, you can shrink the page's padding a bit further by adding the following CSS and modifying the number value:

    .product-layout-side-by-side {
      padding-top: 2vw !important;
    }

    Hope this helps!
    -Tyler

  7. Hi @Hannah96,

    Sure thing - I'd be happy to take a look. Can you comment or DM me a link to your site? If your referencing the visibility of dropdown folders, that's a slightly different issue. We've got some free code snippets for that here: https://squareada.com/resources/how-to-add-a-focus-indicator-to-your-squarespace-website-diy-guide#:~:text=Bonus%3A Fix Dropdown Navigation Visibility

    -Tyler

  8. @Kurt12345678 Try adding the following within Settings > Advanced > Code Injection:

    <!-- jQuery -->
    <script src="https://code.jquery.com/jquery-3.5.0.min.js"></script>
    
    <!-- Accessible Mobile Navigation - Five Template -->
    <script>
      // assign role=button so screen readers announce the label as a button 
      $("#mobile-navigation-label").attr("role", "button");
      
      // assign an aria-label as an invisible screen reader label so the button isn't empty
      $("#mobile-navigation-label").attr("aria-label", "toggle mobile navigation menu");
      
      // add tabindex value so button is focusable by keyboard navigation
      $("#mobile-navigation-label").attr("tabindex", "0");
      
      // add event listener so button can be triggered by pressing enter or space keys
      $("#mobile-navigation-label").keyup(function(event) {
        event.preventDefault();
        if (event.keyCode == 13 || event.keyCode == 32) {
          document.activeElement.click();
        }
      });
    </script>

     

    With this expected result using exclusively keyboard navigation:

    765457289_ezgif.com-gif-maker(8).thumb.gif.d2a0520e4f7e4af90e56e6c110d39bf7.gif

     

    This code is based on the standardized WAI-ARIA design pattern for a button: https://www.w3.org/TR/wai-aria-practices/#button

    You cited WCAG Success Criterion 3.2.1, but I don't think that's applicable here (it prohibits a change of context, such as if focusing the button caused the menu to automatically open without pressing enter). More pertinent are 2.1.1 and 4.1.2 😎 Regardless though, good on ya for being proactive about accessibility!

    Hope this helps!
    -Tyler

     

  9. On 5/27/2021 at 8:34 PM, creedon said:

    FYI @tcp13 works for an company that makes accessibility software for SS sites if you need such software.

    giphy.webp

    Hey hey! I'm a certified Web Accessibility Specialist and the founder of Square ADA. Great question @KickinGa!

    WCAG (the golden standard of web accessibility) actually states in SC 1.1.1 that if an image is "pure decoration" or "used only for visual formatting," then it should be "implemented in a way that it can be ignored by assistive technology."

    Translation - If the image isn't communicating any meaningful information, then we assign a null alt attribute to tell screen readers it's okay to skip the image (WCAG Technique H67). When used correctly, null alt text provides a better experience, since blind folks typically don't care about every little decorative icon or scenic background photo when trying to find information on your site.

    In the case of the 7.1 site you linked (and @herobirthservices mentioned), the null alt tag is already assigned by Squarespace on all background images. So from an accessibility standpoint, this is technically compliant.

    image.thumb.png.b8ad1cc4f37d505e6e99edc02a66973e.png

    However, if there's meaningful content in the background image that needed to be assigned alt text (such as using an image of text), you could use custom code to override the default null value:

    <!-- jQuery -->
    <script src="https://code.jquery.com/jquery-3.5.0.min.js"></script>
    
    <!-- Override Alt Text Value -->
    <script>
      $(document).ready(function(){
        $("section[data-section-id='5f5726f0974f98058a7f632f'] .section-background img").attr("alt", "Lorem Ipsum");
      });
    </script>

    Hope this helps!
    -Tyler

  10. Hi @KriBa,

    Still looking for some help with this? Try adding the following within Settings > Advanced > Code Injection > Header Injection:

    <!-- jQuery -->
    <script src="https://code.jquery.com/jquery-3.5.0.min.js"></script>
    
    <!-- Add Search Labels for Accessibility -->
    <script>
      $(document).ready(function(){
        $(".Header-search-form-input").attr("aria-label", "Search");
        $(".Header-search-form-submit").attr("aria-label", "Submit Search");
      });
    </script>

    If you're looking for further assistance dealing with WAVE errors, feel free to send me a DM or checkout our free audit tool at squareada.com/audit.

    Hope this helps!
    -Tyler

  11. Hi @rTraction,

    Tyler here from SquareADA.com. Sounds like you're using a Bedford-family template! We have a couple blog posts with free code snippets that might help:

    We also have a free accessibility audit tool, and if you're looking for a more robust solution, we're available for hire via our done-for-you accessibility service. Feel free to send us an email or DM me with any other accessibility questions.

    Hope this helps!
    -Tyler

  12. 9 minutes ago, ConradH said:

    Do you know if there's a way to hide the Print button on mobile screens for multiple pages without targeting the block code for every individual button?

    @ConradH Try adding this in Design > Custom CSS:

    @media only screen and (max-width: 768px) {
      a.sqs-block-button-element[href="javascript:window.print();"]{display:none!important;}
    }

     

    With this expected result:

     image.png.3a69c7667a4dd4feb3d318e931256171.png         image.png.4dc39a8fec24e44a3326a2906c3720ef.png

     

    Hope this helps,
    -Tyler

  13. 1 hour ago, northamrealty said:

    appears to only work on the home page

    Ah, sorry about that @northamrealty! It appears your homepage has a different selector since it's an Index Page. Try modifying it one more time to target .Content-outer instead of .Index

    <!--Skip Link-->
    <script>
      $(document).ready(function(){$("body").prepend('<a href="javascript:skipTrigger();" class="skip-link" tabindex="0">Skip to Content</a>');});
      function skipTrigger(){$(".Content-outer").attr("tabindex", "-1").focus();}
    </script>

    That should work on every page within your template (include the homepage too). Feel free to DM me if you encounter any other issues.

  14. On 7/21/2020 at 11:25 AM, ch71579 said:

    By default, Squarespace uses the title of the blog post as the ALT text for the image, but this makes absolutely no sense and certainly doesn't do any good for a blind user.

    Hey @ch71579,

    Tyler here from SquareADA.com! Not sure about the SEO concerns or complex custom code mentioned in this tread, but to your original point about accessibility - the way it's setup is actually correct.

    If we dig into WCAG (that's the international standard on web accessibility), we see from Technique H30 that "When an image is the only content of a link, the text alternative for the image describes the unique function of the link."

    So in other words, for a summary block or grid of blog thumbnail images, it's more appropriate to describe the function of where that link goes (ie the name of the blog post) instead of a typical visual description of the image.

    Hope this helps!
    -Tyler

    PS - If you looking for additional assistance with WCAG and ADA compliance, check out this free accessibility audit tool.

  15. Hey there @northamrealty,

    35 minutes ago, northamrealty said:

    It's actually a different target element for your template. Use the same code as above, but swap out this section with the following:

    <!--Skip Link-->
    <script>
      $(document).ready(function(){$("body").prepend('<a href="javascript:skipTrigger();" class="skip-link" tabindex="0">Skip to Content</a>');});
      function skipTrigger(){$(".Index").attr("tabindex", "-1").focus();}
    </script>

    Hope this helps!
    -Tyler

  16. May 2021 EDIT: We recently published a blog post with free template-specific code snippets for almost every 7.0 template: https://squareada.com/resources/how-to-add-a-skip-link-to-your-squarespace-website-diy-guide

    ---

    Hey there @kyledavis726 and @JTheater,

    Skip links are built-in to all of the newer Squarespace templates running version 7.1, but if you're using a older template running version 7.0, you'll have to implement one with custom code.

    In the case of the Westlake site you linked, try adding the following into Settings > Advanced > Code Injection > Header Injection:

    <!--jQuery-->
    <script src="https://code.jquery.com/jquery-3.5.0.min.js"></script>
    
    <!--Skip Link-->
    <script>
      $(document).ready(function(){$("body").prepend('<a href="javascript:skipTrigger();" class="skip-link" tabindex="0">Skip to Content</a>');});
      function skipTrigger(){$("#page").attr("tabindex", "-1").focus();}
    </script>
    
    <!--Skip Link Styles-->
    <style>
      .skip-link {position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden;}
      .skip-link:focus {left:10px;top:10px;width:auto;height:auto;overflow:visible;background-color:#0f0f0f;color:#f0f0f0;size:1em;padding-top:0.5em;padding-bottom:0.5em;padding-left:1em;padding-right:1em;z-index: 99999;}
    </style>

    With this expected result when pressing the Tab key to navigate:

    47939115_ezgif.com-gif-maker(5).gif.56fab95aa43c192d1d5322d7b1c8fe71.gif

    Hope this helps! Of course, adding a skip link is only a small component of WCAG compliance. If you're looking for a more robust accessibility solution, be sure to checkout the free audit tool linked in my forum signature, or consider working with an accessibility specialist such as myself to develop a more comprehensive strategy for your site.

    Feel free to send me a DM if you need any further assistance with the skip link!
    -Tyler

  17. You're close, @ConradH! Try targeting the img itself instead of its parent anchor element:

    /*change logo img src*/
    .header-title-logo img {
    	content: url('https://images.squarespace-cdn.com/content/v1/5fa318d8aa276a66ec5322fb/1609611984060-SAYWOSH6ATQYL3QJ5SU7/ke17ZwdGBToddI8pDm48kLkAmGt-nEc-KDyOz6MyEdx7gQa3H78H3Y0txjaiv_0fDoOvxcdMmMKkDsyUqMSsMWxHk725yiiHCCLfrh8O1z4YTzHvnKhyp6Da-NYroOW3ZGjoBKy3azqku80C789l0slJ0ZK8bhnMvwBc9-o9uiV5bJKIkPq_14eERHvCXjNC_RY8ahIp3NZpEzceY_TM9w/Logo+Grey+V+Transparent.png') !important;
    }

    If we then remove the teal background, you're left with the new grey logo (which still appears at the top of each page).

    image.thumb.png.3df4e7675335b78e6c5f1d5490e5b11a.png

    To make it appear on only the first page, add this line of CSS:

    /*logo on only first page*/
    #header,.header-inner {
      position:absolute !important;
    }

    With this expected result:

    image.thumb.png.437ae2ebc3ec2ef0c1a130e05576684e.png

    Hope this helps!
    -Tyler

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.