@samhermes/alexander 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,133 @@
1
+ # Alexander
2
+
3
+ Front-end starter kit
4
+
5
+ ## About
6
+
7
+ Alexander was built in two distinct levels, a base level that includes browser consistency styles and standard accessibility features, and an implementation level, broken out into elements and components. Include just the base level in your project and or include all for a jump start.
8
+
9
+ ## Installation
10
+
11
+ Install Alexander from GitHub using npm with:
12
+
13
+ ```bash
14
+ npm install samhermes/alexander#1.1.1
15
+ ```
16
+
17
+ ## Styles
18
+
19
+ You can import the base and element SCSS into your project with `@use`:
20
+
21
+ ```scss
22
+ @use '/node_modules/alexander/scss';
23
+ ```
24
+
25
+ Alternatively, you can include the base or element SCSS as needed, either as groups or individually.
26
+
27
+ ```scss
28
+ @use '/node_modules/alexander/scss/base';
29
+ @use '/node_modules/alexander/scss/elements';
30
+
31
+ // Individual element.
32
+ @use '/node_modules/alexander/scss/elements/blockquote';
33
+ ```
34
+
35
+ All component SCSS needs to be included individually.
36
+
37
+ ```scss
38
+ @use '/node_modules/alexander/scss/components/card';
39
+ ```
40
+
41
+ ## Components
42
+
43
+ Components are not included with Alexander by default. They can be imported as needed and customized to fit your project.
44
+
45
+ ### Accordion
46
+
47
+ Creates an interactive accordion component, with the proper attributes applied to make it accessible.
48
+
49
+ How to use:
50
+
51
+ ```html
52
+ <alexander-accordion>
53
+ <div class="accordion-heading">
54
+ <h2>Accordion 1 heading</h2>
55
+ </div>
56
+ <div class="accordion-content">
57
+ <p>Accordion 1 content</p>
58
+ </div>
59
+ </alexander-accordion>
60
+ ```
61
+
62
+ ```js
63
+ import { Accordion } from 'alexander';
64
+
65
+ new Accordion();
66
+ ```
67
+
68
+ ```scss
69
+ @use '/node_modules/alexander/scss/components/accordion';
70
+ ```
71
+
72
+ ### Tabs
73
+
74
+ Creates an interactive tabs component, with the proper attributes applied to make it accessible.
75
+
76
+ How to use:
77
+
78
+ ```html
79
+ <alexander-tabs>
80
+ <ul role="tablist">
81
+ <li role="presentation">
82
+ <button type="button" id="tab-1" role="tab" aria-controls="tab-1-panel" aria-selected="true">Tab 1</button>
83
+ </li>
84
+ <li role="presentation">
85
+ <button type="button" id="tab-2" role="tab" aria-controls="tab-2-panel" aria-selected="false">Tab 2</button>
86
+ </li>
87
+ <li role="presentation">
88
+ <button type="button" id="tab-3" role="tab" aria-controls="tab-3-panel" aria-selected="false">Tab 3</button>
89
+ </li>
90
+ </ul>
91
+ <div id="tab-1-panel" role="tabpanel" aria-labelledby="tab-1" aria-hidden="false">
92
+ <p>Tab 1 content</p>
93
+ </div>
94
+ <div id="tab-2-panel" role="tabpanel" aria-labelledby="tab-2" aria-hidden="true">
95
+ <p>Tab 2 content</p>
96
+ </div>
97
+ <div id="tab-3-panel" role="tabpanel" aria-labelledby="tab-3" aria-hidden="true">
98
+ <p>Tab 3 content</p>
99
+ </div>
100
+ </alexander-tabs>
101
+ ```
102
+
103
+ ```js
104
+ import { Tabs } from 'alexander';
105
+
106
+ new Tabs();
107
+ ```
108
+
109
+ ```scss
110
+ @use '/node_modules/alexander/scss/components/tabs';
111
+ ```
112
+
113
+ ### Video Controls
114
+
115
+ Adds custom video controls to HTML `video` elements, with the proper attributes applied to make it accessible.
116
+
117
+ How to use:
118
+
119
+ ```html
120
+ <alexander-video>
121
+ <video src="/example/src/video.js"></video>
122
+ </alexander-video>
123
+ ```
124
+
125
+ ```js
126
+ import { Video } from 'alexander';
127
+
128
+ new Video();
129
+ ```
130
+
131
+ ```scss
132
+ @use '/node_modules/alexander/scss/components/video';
133
+ ```
@@ -0,0 +1,76 @@
1
+ //#region src/components/accordion/index.js
2
+ var e = class extends HTMLElement {
3
+ constructor() {
4
+ super();
5
+ }
6
+ open(e, t) {
7
+ let n = t.content.scrollHeight;
8
+ t.content.style.height = n + "px", t.content.addEventListener("transitionend", function() {
9
+ t.content.style.height = "auto";
10
+ }, { once: !0 }), e.classList.add("is-active");
11
+ }
12
+ close(e, t) {
13
+ let n = window.matchMedia("(prefers-reduced-motion: reduce)"), r = t.content.scrollHeight, i = t.content.style.transition;
14
+ t.content.style.transition = "", requestAnimationFrame(() => {
15
+ t.content.style.height = r + "px", t.content.style.transition = i, requestAnimationFrame(() => {
16
+ t.content.style.height = "0px";
17
+ });
18
+ }), n.matches ? e.classList.remove("is-active") : e.addEventListener("transitionend", function() {
19
+ e.classList.remove("is-active");
20
+ }, { once: !0 });
21
+ }
22
+ connectedCallback() {
23
+ let e = {
24
+ heading: this.querySelector(".accordion-heading > *"),
25
+ content: this.querySelector(".accordion-content"),
26
+ headingChildren: this.querySelector(".accordion-heading > *").innerHTML
27
+ };
28
+ this.classList.add("is-accordion");
29
+ let t = document.createElement("button"), n = Math.random().toString(16).slice(2);
30
+ t.setAttribute("type", "button"), t.setAttribute("aria-controls", "accordion-content-" + n), t.setAttribute("id", "accordion-button-" + n), t.setAttribute("aria-expanded", "false"), t.innerHTML = e.headingChildren, e.heading.innerHTML = "", e.heading.appendChild(t), e.content.setAttribute("id", "accordion-content-" + n), e.content.setAttribute("aria-labelledby", "accordion-button-" + n), e.content.setAttribute("role", "region"), t.addEventListener("click", () => {
31
+ let n = t.getAttribute("aria-expanded");
32
+ n === "true" ? t.setAttribute("aria-expanded", "false") : t.setAttribute("aria-expanded", "true"), n === "true" ? this.close(this, e) : this.open(this, e);
33
+ });
34
+ }
35
+ };
36
+ customElements.define("alexander-accordion", e);
37
+ //#endregion
38
+ //#region src/components/tabs/index.js
39
+ var t = class extends HTMLElement {
40
+ constructor() {
41
+ super();
42
+ }
43
+ connectedCallback() {
44
+ let e = this.querySelectorAll("[role=\"tab\"]");
45
+ e.forEach((t) => {
46
+ t.addEventListener("click", (n) => {
47
+ n.preventDefault(), e.forEach((e) => {
48
+ e.setAttribute("aria-selected", "false");
49
+ }), t.setAttribute("aria-selected", "true");
50
+ let r = t.getAttribute("aria-controls"), i = tabContainer.querySelector("#" + r.toString());
51
+ tabContainer.querySelectorAll("[role=\"tabpanel\"]").forEach((e) => {
52
+ e.setAttribute("aria-hidden", "true");
53
+ }), i.setAttribute("aria-hidden", "false");
54
+ });
55
+ });
56
+ }
57
+ };
58
+ customElements.define("alexander-tabs", t);
59
+ //#endregion
60
+ //#region src/components/video/index.js
61
+ var n = class extends HTMLElement {
62
+ constructor() {
63
+ super();
64
+ }
65
+ connectedCallback() {
66
+ let e = this.querySelector("video"), t = document.createElement("div"), n = document.createElement("button"), r = document.createElement("button");
67
+ t.classList.add("video-controls"), n.setAttribute("type", "button"), n.innerHTML = "<span class=\"screen-reader-text\">Play</span>", n.classList.add("control-play"), n.classList.add("hidden"), r.setAttribute("type", "button"), r.innerHTML = "<span class=\"screen-reader-text\">Pause</span>", r.classList.add("control-pause"), t.appendChild(n), t.appendChild(r), e.after(t), n.addEventListener("click", () => {
68
+ e.play(), n.classList.add("hidden"), r.classList.remove("hidden"), r.focus();
69
+ }), r.addEventListener("click", () => {
70
+ e.pause(), r.classList.add("hidden"), n.classList.remove("hidden"), n.focus();
71
+ });
72
+ }
73
+ };
74
+ customElements.define("alexander-video", n);
75
+ //#endregion
76
+ export { e as Accordion, t as Tabs, n as Video };
@@ -0,0 +1 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Alexander={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=class extends HTMLElement{constructor(){super()}open(e,t){let n=t.content.scrollHeight;t.content.style.height=n+`px`,t.content.addEventListener(`transitionend`,function(){t.content.style.height=`auto`},{once:!0}),e.classList.add(`is-active`)}close(e,t){let n=window.matchMedia(`(prefers-reduced-motion: reduce)`),r=t.content.scrollHeight,i=t.content.style.transition;t.content.style.transition=``,requestAnimationFrame(()=>{t.content.style.height=r+`px`,t.content.style.transition=i,requestAnimationFrame(()=>{t.content.style.height=`0px`})}),n.matches?e.classList.remove(`is-active`):e.addEventListener(`transitionend`,function(){e.classList.remove(`is-active`)},{once:!0})}connectedCallback(){let e={heading:this.querySelector(`.accordion-heading > *`),content:this.querySelector(`.accordion-content`),headingChildren:this.querySelector(`.accordion-heading > *`).innerHTML};this.classList.add(`is-accordion`);let t=document.createElement(`button`),n=Math.random().toString(16).slice(2);t.setAttribute(`type`,`button`),t.setAttribute(`aria-controls`,`accordion-content-`+n),t.setAttribute(`id`,`accordion-button-`+n),t.setAttribute(`aria-expanded`,`false`),t.innerHTML=e.headingChildren,e.heading.innerHTML=``,e.heading.appendChild(t),e.content.setAttribute(`id`,`accordion-content-`+n),e.content.setAttribute(`aria-labelledby`,`accordion-button-`+n),e.content.setAttribute(`role`,`region`),t.addEventListener(`click`,()=>{let n=t.getAttribute(`aria-expanded`);n===`true`?t.setAttribute(`aria-expanded`,`false`):t.setAttribute(`aria-expanded`,`true`),n===`true`?this.close(this,e):this.open(this,e)})}};customElements.define(`alexander-accordion`,t);var n=class extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.querySelectorAll(`[role="tab"]`);e.forEach(t=>{t.addEventListener(`click`,n=>{n.preventDefault(),e.forEach(e=>{e.setAttribute(`aria-selected`,`false`)}),t.setAttribute(`aria-selected`,`true`);let r=t.getAttribute(`aria-controls`),i=tabContainer.querySelector(`#`+r.toString());tabContainer.querySelectorAll(`[role="tabpanel"]`).forEach(e=>{e.setAttribute(`aria-hidden`,`true`)}),i.setAttribute(`aria-hidden`,`false`)})})}};customElements.define(`alexander-tabs`,n);var r=class extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.querySelector(`video`),t=document.createElement(`div`),n=document.createElement(`button`),r=document.createElement(`button`);t.classList.add(`video-controls`),n.setAttribute(`type`,`button`),n.innerHTML=`<span class="screen-reader-text">Play</span>`,n.classList.add(`control-play`),n.classList.add(`hidden`),r.setAttribute(`type`,`button`),r.innerHTML=`<span class="screen-reader-text">Pause</span>`,r.classList.add(`control-pause`),t.appendChild(n),t.appendChild(r),e.after(t),n.addEventListener(`click`,()=>{e.play(),n.classList.add(`hidden`),r.classList.remove(`hidden`),r.focus()}),r.addEventListener(`click`,()=>{e.pause(),r.classList.add(`hidden`),n.classList.remove(`hidden`),n.focus()})}};customElements.define(`alexander-video`,r),e.Accordion=t,e.Tabs=n,e.Video=r});
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@samhermes/alexander",
3
+ "version": "1.1.1",
4
+ "description": "Front-End Starter Kit",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/samhermes/alexander.git"
8
+ },
9
+ "author": "Sam Hermes",
10
+ "license": "ISC",
11
+ "bugs": {
12
+ "url": "https://github.com/samhermes/alexander/issues"
13
+ },
14
+ "homepage": "https://github.com/samhermes/alexander#readme",
15
+ "type": "module",
16
+ "main": "dist/js/alexander.js",
17
+ "exports": {
18
+ ".": {
19
+ "import": "./dist/alexander.js",
20
+ "require": "./dist/alexander.umd.cjs"
21
+ }
22
+ },
23
+ "scripts": {
24
+ "build": "vite build",
25
+ "dev": "vite",
26
+ "preview": "vite preview",
27
+ "lint": "eslint src/**/*.js",
28
+ "storybook": "storybook dev -p 6006"
29
+ },
30
+ "files": [
31
+ "dist",
32
+ "scss"
33
+ ],
34
+ "devDependencies": {
35
+ "@storybook/web-components-vite": "^10.5.5",
36
+ "eslint": "^10.8.0",
37
+ "eslint-plugin-compat": "^7.0.2",
38
+ "sass": "^1.71.1",
39
+ "storybook": "^10.5.5",
40
+ "vite": "^8.1.5"
41
+ }
42
+ }
@@ -0,0 +1,95 @@
1
+ /*
2
+ * Alexander
3
+ * Version 1.0.3
4
+ */
5
+
6
+ *,
7
+ *::before,
8
+ *::after {
9
+ box-sizing: border-box;
10
+ }
11
+
12
+ body {
13
+ margin: 0;
14
+ font-size: 1rem;
15
+ font-weight: 400;
16
+ line-height: 1.5;
17
+ color: #303030;
18
+ background-color: #fff;
19
+ -webkit-text-size-adjust: 100%; // Prevent adjustments of font size after orientation changes in iOS.
20
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0); // Change the default tap highlight to be completely transparent in iOS.
21
+ }
22
+
23
+ // From: Bootstrap 5.0.0
24
+ // Future-proof rule: in browsers that support :focus-visible, suppress the focus outline
25
+ // on elements that programmatically receive focus but wouldn't normally show a visible
26
+ // focus outline. In general, this would mean that the outline is only applied if the
27
+ // interaction that led to the element receiving programmatic focus was a keyboard interaction,
28
+ // or the browser has somehow determined that the user is primarily a keyboard user and/or
29
+ // wants focus outlines to always be presented.
30
+ // See https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible
31
+ // and https://developer.paciellogroup.com/blog/2018/03/focus-visible-and-backwards-compatibility/
32
+
33
+ [tabindex="-1"]:focus:not(:focus-visible) {
34
+ outline: 0 !important;
35
+ }
36
+
37
+ address {
38
+ margin-bottom: 1rem;
39
+ font-style: normal;
40
+ line-height: inherit;
41
+ }
42
+
43
+ b,
44
+ strong {
45
+ font-weight: 600;
46
+ }
47
+
48
+ sub,
49
+ sup {
50
+ position: relative;
51
+ font-size: 0.75rem;
52
+ line-height: 0;
53
+ vertical-align: baseline;
54
+ }
55
+
56
+ sub { bottom: -.25em; }
57
+ sup { top: -.5em; }
58
+
59
+ figure {
60
+ margin: 0 0 1rem;
61
+ }
62
+
63
+ img, picture, video, canvas {
64
+ display: block;
65
+ max-width: 100%;
66
+ }
67
+
68
+ img, svg {
69
+ vertical-align: middle;
70
+ }
71
+
72
+ img {
73
+ height: auto;
74
+ }
75
+
76
+ p, h1, h2, h3, h4, h5, h6 {
77
+ overflow-wrap: break-word;
78
+ }
79
+
80
+ a {
81
+ color: #303030;
82
+ }
83
+
84
+ iframe {
85
+ display: block;
86
+ border: 0;
87
+ }
88
+
89
+ input, button, textarea, select {
90
+ font: inherit;
91
+ }
92
+
93
+ [hidden] {
94
+ display: none !important;
95
+ }
@@ -0,0 +1,192 @@
1
+ /*
2
+ * Alexander
3
+ * Version 1.0.0
4
+ */
5
+
6
+ // From Bootstrap 5.0.0
7
+
8
+ // 1. Allow labels to use `margin` for spacing.
9
+
10
+ label {
11
+ display: inline-block; // 1
12
+ }
13
+
14
+ // Remove the default `border-radius` that macOS Chrome adds.
15
+ // See https://github.com/twbs/bootstrap/issues/24093
16
+
17
+ button {
18
+ // stylelint-disable-next-line property-disallowed-list
19
+ border-radius: 0;
20
+ }
21
+
22
+ // Explicitly remove focus outline in Chromium when it shouldn't be
23
+ // visible (e.g. as result of mouse click or touch tap). It already
24
+ // should be doing this automatically, but seems to currently be
25
+ // confused and applies its very visible two-tone outline anyway.
26
+
27
+ button:focus:not(:focus-visible) {
28
+ outline: 0;
29
+ }
30
+
31
+ // 1. Remove the margin in Firefox and Safari
32
+
33
+ input,
34
+ button,
35
+ select,
36
+ optgroup,
37
+ textarea {
38
+ margin: 0; // 1
39
+ font-family: inherit;
40
+ font-size: inherit;
41
+ line-height: inherit;
42
+ }
43
+
44
+ // Remove the inheritance of text transform in Firefox
45
+
46
+ button,
47
+ select {
48
+ text-transform: none;
49
+ }
50
+
51
+ // Set the cursor for non-`<button>` buttons
52
+ //
53
+ // Details at https://github.com/twbs/bootstrap/pull/30562
54
+ [role="button"] {
55
+ cursor: pointer;
56
+ }
57
+
58
+ // Remove the inheritance of word-wrap in Safari.
59
+ // See https://github.com/twbs/bootstrap/issues/24990
60
+
61
+ select {
62
+ word-wrap: normal;
63
+ }
64
+
65
+ // Remove the dropdown arrow in Chrome from inputs built with datalists.
66
+ // See https://stackoverflow.com/a/54997118
67
+
68
+ [list]::-webkit-calendar-picker-indicator {
69
+ display: none;
70
+ }
71
+
72
+ button,
73
+ [type="button"],
74
+ [type="reset"],
75
+ [type="submit"] {
76
+ -webkit-appearance: button;
77
+ cursor: pointer;
78
+ }
79
+
80
+ // Remove inner border and padding from Firefox, but don't restore the outline like Normalize.
81
+
82
+ ::-moz-focus-inner {
83
+ padding: 0;
84
+ border-style: none;
85
+ }
86
+
87
+ // 1. Textareas should really only resize vertically so they don't break their (horizontal) containers.
88
+
89
+ textarea {
90
+ resize: vertical; // 1
91
+ }
92
+
93
+ // 1. Browsers set a default `min-width: min-content;` on fieldsets,
94
+ // unlike e.g. `<div>`s, which have `min-width: 0;` by default.
95
+ // So we reset that to ensure fieldsets behave more like a standard block element.
96
+ // See https://github.com/twbs/bootstrap/issues/12359
97
+ // and https://html.spec.whatwg.org/multipage/#the-fieldset-and-legend-elements
98
+ // 2. Reset the default outline behavior of fieldsets so they don't affect page layout.
99
+
100
+ fieldset {
101
+ min-width: 0; // 1
102
+ padding: 0; // 2
103
+ margin: 0; // 2
104
+ border: 0; // 2
105
+ }
106
+
107
+ // 1. By using `float: left`, the legend will behave like a block element.
108
+ // This way the border of a fieldset wraps around the legend if present.
109
+ // 2. Fix wrapping bug.
110
+ // See https://github.com/twbs/bootstrap/issues/29712
111
+
112
+ legend {
113
+ float: left; // 1
114
+ width: 100%;
115
+ padding: 0;
116
+ margin-bottom: 0.5rem;
117
+ line-height: inherit;
118
+
119
+ + * {
120
+ clear: left; // 2
121
+ }
122
+ }
123
+
124
+ // Fix height of inputs with a type of datetime-local, date, month, week, or time
125
+ // See https://github.com/twbs/bootstrap/issues/18842
126
+
127
+ ::-webkit-datetime-edit-fields-wrapper,
128
+ ::-webkit-datetime-edit-text,
129
+ ::-webkit-datetime-edit-minute,
130
+ ::-webkit-datetime-edit-hour-field,
131
+ ::-webkit-datetime-edit-day-field,
132
+ ::-webkit-datetime-edit-month-field,
133
+ ::-webkit-datetime-edit-year-field {
134
+ padding: 0;
135
+ }
136
+
137
+ ::-webkit-inner-spin-button {
138
+ height: auto;
139
+ }
140
+
141
+ // 1. Correct the outline style in Safari.
142
+ // 2. This overrides the extra rounded corners on search inputs in iOS so that our
143
+ // `.form-control` class can properly style them. Note that this cannot simply
144
+ // be added to `.form-control` as it's not specific enough. For details, see
145
+ // https://github.com/twbs/bootstrap/issues/11586.
146
+
147
+ [type="search"] {
148
+ outline-offset: -2px; // 1
149
+ -webkit-appearance: textfield; // 2
150
+ }
151
+
152
+ // 1. A few input types should stay LTR
153
+ // See https://rtlstyling.com/posts/rtl-styling#form-inputs
154
+ // 2. RTL only output
155
+ // See https://rtlcss.com/learn/usage-guide/control-directives/#raw
156
+
157
+ /* rtl:raw:
158
+ [type="tel"],
159
+ [type="url"],
160
+ [type="email"],
161
+ [type="number"] {
162
+ direction: ltr;
163
+ }
164
+ */
165
+
166
+ // Remove the inner padding in Chrome and Safari on macOS.
167
+
168
+ ::-webkit-search-decoration {
169
+ -webkit-appearance: none;
170
+ }
171
+
172
+ // Remove padding around color pickers in webkit browsers
173
+
174
+ ::-webkit-color-swatch-wrapper {
175
+ padding: 0;
176
+ }
177
+
178
+
179
+ // Inherit font family and line height for file input buttons
180
+
181
+ // stylelint-disable-next-line selector-pseudo-element-no-unknown
182
+ ::file-selector-button {
183
+ font: inherit;
184
+ }
185
+
186
+ // 1. Change font properties to `inherit`
187
+ // 2. Correct the inability to style clickable types in iOS and Safari.
188
+
189
+ ::-webkit-file-upload-button {
190
+ font: inherit; // 1
191
+ -webkit-appearance: button; // 2
192
+ }
@@ -0,0 +1,16 @@
1
+ /*
2
+ * Alexander
3
+ * Version 1.0.0
4
+ */
5
+
6
+ .screen-reader-text {
7
+ position: absolute;
8
+ width: 1px;
9
+ height: 1px;
10
+ padding: 0;
11
+ margin: -1px;
12
+ overflow: hidden;
13
+ clip-path: inset(50%);
14
+ white-space: nowrap;
15
+ border: 0;
16
+ }
@@ -0,0 +1,17 @@
1
+ /*
2
+ * Alexander
3
+ * Version 1.0.0
4
+ */
5
+
6
+ .skip-link:focus {
7
+ background-color: #fff;
8
+ border: 2px solid currentColor;
9
+ clip: auto;
10
+ left: 0.5rem;
11
+ top: 0.5rem;
12
+ width: auto;
13
+ height: auto;
14
+ padding: 0.5rem 1rem;
15
+ margin: 0;
16
+ z-index: 100000;
17
+ }
@@ -0,0 +1,5 @@
1
+ // Base - always included
2
+ @use 'base/base';
3
+ @use 'base/screen-reader-text';
4
+ @use 'base/skip-link';
5
+ @use 'base/form';
@@ -0,0 +1,78 @@
1
+ /*
2
+ * Alexander
3
+ * Version 1.0.6
4
+ */
5
+
6
+ alexander-accordion {
7
+ margin-bottom: 2rem;
8
+
9
+ &:last-child {
10
+ margin-bottom: 0;
11
+ }
12
+
13
+ &.is-accordion {
14
+ margin-bottom: 0.5rem;
15
+
16
+ .accordion-heading {
17
+ cursor: pointer;
18
+ position: relative;
19
+
20
+ h2,
21
+ h3,
22
+ h4,
23
+ h5,
24
+ h6 {
25
+ font-size: 1.3rem;
26
+ margin: 0;
27
+ }
28
+
29
+ button {
30
+ background: none;
31
+ border: none;
32
+ border-radius: 0;
33
+ box-shadow: none;
34
+ padding: 0;
35
+ margin: 0;
36
+ color: inherit;
37
+ display: block;
38
+ width: 100%;
39
+ text-align: left;
40
+
41
+ &:hover,
42
+ &:focus {
43
+ text-decoration: underline;
44
+ }
45
+ }
46
+ }
47
+
48
+ .accordion-content {
49
+ overflow: hidden;
50
+ height: 0;
51
+ visibility: hidden;
52
+
53
+ @media screen and (prefers-reduced-motion: no-preference) {
54
+ transition: height 0.3s cubic-bezier(0.65, 0.05, 0.36, 1);
55
+ }
56
+
57
+ @media print {
58
+ height: auto;
59
+ visibility: visible;
60
+ }
61
+
62
+ & > :first-child {
63
+ padding-top: 1rem;
64
+ }
65
+
66
+ & > :last-child {
67
+ margin-bottom: 0;
68
+ padding-bottom: 2rem;
69
+ }
70
+ }
71
+
72
+ &.is-active {
73
+ .accordion-content {
74
+ visibility: visible;
75
+ }
76
+ }
77
+ }
78
+ }
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Alexander
3
+ * Version 1.0.0
4
+ */
5
+
6
+ .card {
7
+ display: flex;
8
+ flex-direction: column;
9
+
10
+ .card-contents {
11
+ padding: 1.2rem 1.5rem 1.4rem;
12
+ }
13
+
14
+ .card-image {
15
+ order: -1;
16
+
17
+ img {
18
+ object-fit: cover;
19
+ aspect-ratio: 16 / 9;
20
+ width: 100%;
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Alexander
3
+ * Version 1.0.0
4
+ */
5
+
6
+ .input-group {
7
+ margin-bottom: 1.5rem;
8
+
9
+ &:last-child {
10
+ margin-bottom: 0;
11
+ }
12
+ }
13
+
14
+ label {
15
+ margin-bottom: 0.5rem;
16
+ }
17
+
18
+ input[type="text"],
19
+ textarea {
20
+ display: block;
21
+ width: 100%;
22
+ padding: 0.3rem 0.6rem;
23
+ }
@@ -0,0 +1,26 @@
1
+ /*
2
+ * Alexander
3
+ * Version 1.0.0
4
+ */
5
+
6
+ .icon-list {
7
+ list-style: none;
8
+ padding-left: 0;
9
+
10
+ li {
11
+ position: relative;
12
+ padding-left: 2.2rem;
13
+ margin-bottom: 0.7rem;
14
+
15
+ &::before {
16
+ content: '';
17
+ position: absolute;
18
+ top: 0.25rem;
19
+ left: 0;
20
+ width: 1.3rem;
21
+ height: 1.3rem;
22
+ background-size: 1.3rem;
23
+ background-repeat: no-repeat;
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,26 @@
1
+ /*
2
+ * Alexander
3
+ * Version 1.0.0
4
+ */
5
+
6
+ [role="tablist"] {
7
+ list-style: none;
8
+ padding: 0;
9
+ margin: 0;
10
+ display: flex;
11
+
12
+ button {
13
+ display: block;
14
+ background: none;
15
+ border: none;
16
+ color: inherit;
17
+ padding: 0;
18
+ margin: 0;
19
+ }
20
+ }
21
+
22
+ [role="tabpanel"] {
23
+ &:not([aria-hidden="false"]) {
24
+ display: none;
25
+ }
26
+ }
@@ -0,0 +1,15 @@
1
+ .video-controls {
2
+ button {
3
+ background: transparent;
4
+ background-size: contain;
5
+ background-repeat: no-repeat;
6
+ border: 0;
7
+ padding: 0;
8
+ width: 2rem;
9
+ height: 2rem;
10
+ }
11
+
12
+ .hidden {
13
+ display: none;
14
+ }
15
+ }
@@ -0,0 +1,12 @@
1
+ /*
2
+ * Alexander
3
+ * Version 1.0.0
4
+ */
5
+
6
+ blockquote {
7
+ margin: 0 0 1rem;
8
+
9
+ &:last-child {
10
+ margin-bottom: 0;
11
+ }
12
+ }
@@ -0,0 +1,45 @@
1
+ /*
2
+ * Alexander
3
+ * Version 1.0.0
4
+ */
5
+
6
+ // From Bootstrap 5.0.0
7
+
8
+ pre,
9
+ code,
10
+ kbd,
11
+ samp {
12
+ font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
13
+ font-size: 1rem;
14
+ direction: ltr #{"/* rtl:ignore */"};
15
+ unicode-bidi: bidi-override;
16
+ }
17
+
18
+ // 1. Remove browser default top margin
19
+ // 2. Reset browser default of `1em` to use `rem`s
20
+ // 3. Don't allow content to break outside
21
+
22
+ pre {
23
+ display: block;
24
+ margin-top: 0; // 1
25
+ margin-bottom: 1rem; // 2
26
+ overflow: auto; // 3
27
+ font-size: 1rem;
28
+
29
+ // Account for some code outputs that place code tags in pre tags
30
+ code {
31
+ font-size: inherit;
32
+ color: inherit;
33
+ word-break: normal;
34
+ }
35
+ }
36
+
37
+ code {
38
+ font-size: 1rem;
39
+ word-wrap: break-word;
40
+
41
+ // Streamline the style when inside anchors to avoid broken underline and more
42
+ a > & {
43
+ color: inherit;
44
+ }
45
+ }
@@ -0,0 +1,77 @@
1
+ /*
2
+ * Alexander
3
+ * Version 1.0.0
4
+ */
5
+
6
+ /*
7
+ * Uses the following scales:
8
+ * - Major Second https://type-scale.com/?size=16&scale=1.200
9
+ * - Above 50em: Hexatonic Scale, Fibonacci Series https://www.layoutgridcalculator.com/typographic-scale/
10
+ */
11
+
12
+ %heading {
13
+ margin-top: 0;
14
+ margin-bottom: 0.5em;
15
+ font-weight: 600;
16
+ line-height: 1.2;
17
+
18
+ &:not(:first-child) {
19
+ margin-top: 1em;
20
+ }
21
+ }
22
+
23
+ h1,
24
+ .heading-1 {
25
+ @extend %heading;
26
+ font-size: 1.802rem;
27
+
28
+ @media screen and (min-width: 50em) {
29
+ font-size: 2.625rem;
30
+ }
31
+ }
32
+
33
+ h2,
34
+ .heading-2 {
35
+ @extend %heading;
36
+ font-size: 1.602rem;
37
+
38
+ @media screen and (min-width: 50em) {
39
+ font-size: 1.7708rem;
40
+ }
41
+ }
42
+
43
+ h3,
44
+ .heading-3 {
45
+ @extend %heading;
46
+ font-size: 1.424rem;
47
+
48
+ @media screen and (min-width: 50em) {
49
+ font-size: 1.3958rem;
50
+ }
51
+ }
52
+
53
+ h4,
54
+ .heading-4 {
55
+ @extend %heading;
56
+ font-size: 1.266rem;
57
+
58
+ @media screen and (min-width: 50em) {
59
+ font-size: 1.1875rem;
60
+ }
61
+ }
62
+
63
+ h5,
64
+ .heading-5 {
65
+ @extend %heading;
66
+ font-size: 1.125rem;
67
+
68
+ @media screen and (min-width: 50em) {
69
+ font-size: 1.1042rem;
70
+ }
71
+ }
72
+
73
+ h6,
74
+ .heading-6 {
75
+ @extend %heading;
76
+ font-size: 1rem;
77
+ }
@@ -0,0 +1,11 @@
1
+ /*
2
+ * Alexander
3
+ * Version 1.0.0
4
+ */
5
+
6
+ hr {
7
+ margin: 2rem 0;
8
+ background-color: currentColor;
9
+ border: 0;
10
+ height: 0.125rem;
11
+ }
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Alexander
3
+ * Version 1.0.0
4
+ */
5
+
6
+ ol,
7
+ ul {
8
+ padding-left: 2rem;
9
+ }
10
+
11
+ ol,
12
+ ul,
13
+ dl {
14
+ margin-top: 0;
15
+ margin-bottom: 1rem;
16
+
17
+ &:last-child {
18
+ margin-bottom: 0;
19
+ }
20
+ }
21
+
22
+ ol ol,
23
+ ul ul,
24
+ ol ul,
25
+ ul ol {
26
+ margin-bottom: 0;
27
+ }
@@ -0,0 +1,13 @@
1
+ /*
2
+ * Alexander
3
+ * Version 1.0.0
4
+ */
5
+
6
+ p {
7
+ margin-top: 0;
8
+ margin-bottom: 1rem;
9
+
10
+ &:last-child {
11
+ margin-bottom: 0;
12
+ }
13
+ }
@@ -0,0 +1,38 @@
1
+ /*
2
+ * Alexander
3
+ * Version 1.0.0
4
+ */
5
+
6
+ // From Bootstrap 5.0.0
7
+
8
+ table {
9
+ caption-side: bottom;
10
+ border-collapse: collapse;
11
+ }
12
+
13
+ caption {
14
+ padding-top: 0.5rem;
15
+ padding-bottom: 0.5rem;
16
+ text-align: left;
17
+ }
18
+
19
+ // 1. Removes font-weight bold by inheriting
20
+ // 2. Matches default `<td>` alignment by inheriting `text-align`.
21
+ // 3. Fix alignment for Safari
22
+
23
+ th {
24
+ font-weight: 600; // 1
25
+ text-align: inherit; // 2
26
+ text-align: -webkit-match-parent; // 3
27
+ }
28
+
29
+ thead,
30
+ tbody,
31
+ tfoot,
32
+ tr,
33
+ td,
34
+ th {
35
+ border-color: inherit;
36
+ border-style: solid;
37
+ border-width: 0;
38
+ }
@@ -0,0 +1,8 @@
1
+ // Elements
2
+ @use 'elements/blockquote';
3
+ @use 'elements/code';
4
+ @use 'elements/heading';
5
+ @use 'elements/hr';
6
+ @use 'elements/list';
7
+ @use 'elements/paragraph';
8
+ @use 'elements/table';
@@ -0,0 +1,14 @@
1
+ // Base - always included
2
+ @use 'base/base';
3
+ @use 'base/screen-reader-text';
4
+ @use 'base/skip-link';
5
+ @use 'base/form';
6
+
7
+ // Elements - project by project
8
+ @use 'elements/blockquote';
9
+ @use 'elements/heading';
10
+ @use 'elements/code';
11
+ @use 'elements/hr';
12
+ @use 'elements/list';
13
+ @use 'elements/paragraph';
14
+ @use 'elements/table';