Skip to content

Instantly share code, notes, and snippets.

@stevebosworth
stevebosworth / a11y-examples-price.liquid
Last active March 21, 2017 17:32
a11y-examples-price
<li>
<span id=”productPrice”>
<span aria-hidden=”true”>199<sup>99</sup></span>
<span class=”visually-hidden”>$199.99</span>
</span>
</li>
<style>
.visually-hidden {
position: absolute !important;
@stevebosworth
stevebosworth / a11y-examples-sale-price.liquid
Last active March 21, 2017 17:34
a11y-examples-sale-price
{% if product.compare_at_price > product.price %>
<span class=”visually-hidden”>Regular Price</span>
<span id=”ComparePrice”> $100</span>
<span class=”visually-hidden”>Sale price</span>
{% endif %}
<span id=”ProductPrice” itemprop=”price”>$50</span>
<style>
.visually-hidden {
@stevebosworth
stevebosworth / a11y-examples-table.liquid
Last active January 19, 2022 06:45
a11y-examples-table.liquid
<table class=”responsive-table”>
<thead>
<th>Product</th>
<th>Price</th>
<th>Quantity</th>
<th>Total</th>
</thead>
</tbody>
{% for item in cart.items %}
<tr class=”responsive-table__row”>
@stevebosworth
stevebosworth / a11y-form-example.liquid
Last active March 21, 2017 17:29
a11y-form-example.liquid
{% form ‘new_comment’, article %}
{{ form.errors | default_errors }}
<label for=”CommentAuthor” class=”hidden-label”>Name</label>
<input {% if form.errors contains 'author' %}class=”error”{% endif %} type=”text” name=”comment[author]” placeholder=”Name” id=”CommentAuthor” value=”{{ form.author }}”>
<label for=”CommentEmail” class=”hidden-label”>Email</label>
<input {% if form.errors contains 'email' %}class=”error”{% endif %} type=”email” name=”comment[email]” placeholder=”email” id=”CommentEmail” value=”{{ form.email }}” autocorrect=”off” autocapitalize=”off”>
{% endform %}
@stevebosworth
stevebosworth / icon-fallback-text.liquid
Last active March 21, 2017 17:22
icon-fallback-text
<button type=”button”>
<span class=”icon icon--cart” aria-hidden=”true”></span>
<span class=”fallback-text”>cart</span>
</button>
<style>
.fallback-text {
position: absolute !important;
overflow: hidden;
clip: rect(0 0 0 0);
@stevebosworth
stevebosworth / a11y-examples.liquid
Last active November 14, 2016 22:11
Theme a11y examples
<img src=”{{ slide_img | asset_url }}” alt=”{{ settings[slide_heading] }}”>
<img src="{{ product.featured_image.src }}" alt="{{ product.featured_image.alt }}">
@stevebosworth
stevebosworth / gulpfile.js
Created January 20, 2016 22:41
themes-gulpfile
var gulp = require('gulp');
var imagemin = require('gulp-imagemin');
var notify = require('gulp-notify');
var cssimport = require('gulp-cssimport');
var include = require("gulp-include");
var shell = require('gulp-shell');
var zip = require('gulp-zip');
var open = require('gulp-open');
var runSequence = require('run-sequence');
var del = require('del');
#SPECS, STANDARDS, POLICIES
##specifications
- major cause in producing bugs
- established by the customer/owner of the website
##standards
- set of guidelines to follow usually set by a body of professionals (w3c, ISO)
##poliicies
@stevebosworth
stevebosworth / databoundHybridControl.aspx
Last active December 16, 2015 05:19
A custom Databound Dropdownlist using LINQ
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="databoundHybridControl.aspx.cs" Inherits="databoundHybridControl" %>
<%@ Register TagPrefix="DBadvHC" Namespace="databoundHybrid" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
public bool publishPage(int _cmsID, string _parent, string _title, string _publicUrl)
{
string path = System.Web.HttpContext.Current.Server.MapPath("~/web.sitemap");
XmlDocument doc = new XmlDocument();
doc.Load(path);
XmlNode newSiteMapNode = createSiteMapNode(doc, _title, _publicUrl);
//I had an issue here finding siteMapNodes under the root siteMap because of the xml namespace .net uses. You can either remove it or try something like: /siteMap[@xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"/siteMapNode/siteMapNode[@title='" + _parent + "']