Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AV-2089: Make avoindata-expander accessible #2121

Merged
merged 3 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,16 @@ avoindata_ckeditor5_plugins_avoindataexpander:
label: Avoindata Expander
elements:
- <div>
- <div class="avoindata-expander-header">
- <button>
- <button class="avoindata-expander-header">
- <div class="avoindata-expander-title">
- <span>
- <span class="icon-wrapper pull-right">
- <i>
- <i class="fas fa-angle-down">
- <div class="avoindata-expander-content">
- <div role>
- <div role="region">
- <div class="avoindata-expander-content" role="region">

avoindata_ckeditor5_plugins_avoindatanote:
ckeditor5:
Expand Down Expand Up @@ -170,5 +173,6 @@ avoindata_ckeditor5_plugins_avoindatasection:
- <div class id>
- <div class="avoindata-section">
- <div class="avoindata-section-id">
- <div class="avoindata-section-title">
- <h3>
- <h3 class="avoindata-section-title">
- <div class="avoindata-section-content">
191 changes: 108 additions & 83 deletions drupal/modules/avoindata-ckeditor5-plugins/css/styles.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
.external-link {
display: inline-flex;
flex-direction: row;
align-items: center;
}
.external-link::after {
content: '';
width: 24px;
height: 24px;
display: inline-block;
vertical-align: text-top;
transform: scale(.6);
background-image: url(../images/icon-external-link.svg);
}
Expand All @@ -20,30 +17,46 @@
.avoindata-expander + .avoindata-expander {
margin-top: -1px;
}
.avoindata-expander-header {
cursor: pointer;
color: #2a6ebb;
font-family: "Source Sans Pro SemiBold","Helvetica Neue",Arial,sans-serif;
font-size: 18px;
font-weight: 600;
padding: 20px;
display: inline-block;
width: 100%;
background: #f6f9fc;
border-radius: 2px;
box-shadow: 0 2px 4px 1px rgba(41,41,41,.1);
border: 1px solid #ecedee;
margin: 0;
text-align: left;
}
.avoindata-expander-header .icon-wrapper {
float: right;
}
.avoindata-expander.open {
background: #fff;
}
.avoindata-expander.open .avoindata-expander-content,
.avoindata-expander.open .avoindata-expander-content.collapse {
display: block;
}
.avoindata-expander-header {
cursor: pointer;
.avoindata-expander.open .avoindata-expander-header {
background: #fff;
box-shadow: none;
border: 1px solid #fff;
}
.avoindata-expander-title {
color: #2a6ebb;
font-family: "Source Sans Pro SemiBold","Helvetica Neue",Arial,sans-serif;
font-size: 18px;
font-weight: 600;
padding: 20px 0 20px 20px;
padding: 0;
display: inline-block;
width: calc(100% - 45px);
}
.avoindata-expander-title h2,
.avoindata-expander-title h3,
.avoindata-expander-title h4 {
margin: 0;
}
.avoindata-expander-content {
display: none;
padding: 0 20px 15px;
Expand All @@ -56,12 +69,7 @@
.avoindata-expander-content.cke_widget_editable {
display: block;
}
.avoindata-expander-header .icon-wrapper {
float: right;
padding-right: 20px;
padding-top: 24px;
}
.avoindata-expander-header .icon-wrapper i {
.avoindata-expander-header .avoindata-expander-header .icon-wrapper i {
color: #2a6ebb;
}
.avoindata-expander-group-toggler {
Expand Down Expand Up @@ -97,9 +105,6 @@
display: inline-block;
width: calc(100% - 70px);
}
.avoindata-note-title > :last-child {
margin: 0;
}
.avoindata-note-content {
color: #292929;
font-family: "Source Sans Pro Regular","Helvetica Neue",Arial,sans-serif;
Expand All @@ -108,11 +113,6 @@
line-height: 27px;
padding: 0 20px 15px;
}
.avoindata-expander-content p:last-of-type,
.avoindata-hint-content p:last-of-type,
.avoindata-note-content p:last-of-type {
margin-bottom: 0;
}
.avoindata-hint {
margin: 20px 0;
}
Expand Down Expand Up @@ -155,9 +155,6 @@
margin-inline-end: 0;
display: block;
}
.avoindata-example-title > :last-child {
margin: 0;
}
.avoindata-example-content {
color: #292929;
font-family: "Source Sans Pro Regular","Helvetica Neue",Arial,sans-serif;
Expand Down Expand Up @@ -218,6 +215,16 @@ a.external svg {
height: 16px;
fill: #2a6ebb;
}
.avoindata-example-title > p,
.avoindata-example-title > p:last-child,
.avoindata-expander-title > p,
.avoindata-expander-title > p:last-child,
.avoindata-note-title > p,
.avoindata-note-title > p:last-child,
.avoindata-section-title > p,
.avoindata-section-title > p:last-child {
margin-bottom: 0;
}
.ck.ck-editor__main {
height: 100%;
}
Expand All @@ -240,34 +247,71 @@ a.external svg {
.ck-content ol,
.ck-content ul {
margin-top: 0;
margin-bottom: 13.5px;
margin-bottom: 27px;
padding-left: unset;
}
.ck-content p {
margin-bottom: 27px;
margin-top: 0;
margin-bottom: 27px;
}
.ck-content p img:not(.avoindata-hint-icon),
.ck-content p img:not(.avoindata-note-icon) {
.ck-content p img:not(.avoindata-hint-icon,
.avoindata-note-icon) {
margin-bottom: -27px;
}
.ck-content p ~ ol,
.ck-content p ~ ul {
.ck-content p > a img:not(.avoindata-hint-icon,
.avoindata-note-icon) {
margin-bottom: 0;
vertical-align: unset;
}
.ck-content p + ol,
.ck-content p + ul {
margin-top: -27px;
}
.ck-content .external-link {
display: inline-flex;
flex-direction: row;
align-content: center;
.ck-content .avoindata-example-title > p,
.ck-content .avoindata-expander-title > p,
.ck-content .avoindata-note-title > p,
.ck-content .avoindata-section-title > p {
margin-bottom: 0;
}
.ck-content .external-link::after {
content: "";
display: inline-block;
vertical-align: text-top;
width: 24px;
height: 24px;
transform: scale(.6);
margin-left: 2px;
background-image: url(../icons/icon-external-link.svg);
}
.ck-content .avoindata-section {
background-color: #fff;
box-shadow: 0 2px 4px 1px rgba(41,41,41,.2);
border-top: 4px solid #2a6ebb;
border-radius: 4px 4px 0 0;
margin: 45px 0;
padding: 30px;
display: block;
}
.ck-content .avoindata-section:first-of-type {
margin-top: 0;
}
.ck-content .avoindata-section .avoindata-section-title {
margin-top: 0;
margin-bottom: 20px;
display: block;
}
.ck-content .avoindata-section .avoindata-section-title h3,
.ck-content .avoindata-section .avoindata-section-title p {
font-size: 22px;
line-height: 34px;
font-weight: 600;
}
.ck-content .avoindata-section .avoindata-section-content > p {
margin: 0 0 27px;
font-size: 18px;
line-height: 27px;
font-weight: 400;
}
.ck-content .avoindata-expander {
background: #f6f9fc;
border-radius: 2px;
Expand All @@ -279,15 +323,19 @@ a.external svg {
font-size: 18px;
font-weight: 600;
line-height: 27px;
padding: 0 20px 5px;
padding: 20px;
color: #2a6ebb;
display: block;
}
.ck-content .avoindata-expander .avoindata-expander-title h2,
.ck-content .avoindata-expander .avoindata-expander-title h3,
.ck-content .avoindata-expander .avoindata-expander-title h4 {
.ck-content .avoindata-expander .avoindata-expander-title h4,
.ck-content .avoindata-expander .avoindata-expander-title p {
margin: 0;
margin-top: 1em;
font-size: 18px;
font-weight: 600;
line-height: 27px;
color: #2a6ebb;
}
.ck-content .avoindata-expander .avoindata-expander-content {
padding: 0 20px 15px;
Expand Down Expand Up @@ -319,19 +367,22 @@ a.external svg {
padding: 10px 0;
width: calc(100% - 70px);
}
.ck-content .avoindata-note-title > :last-child {
.ck-content .avoindata-note-title p {
margin: 0;
font-size: 20px;
font-weight: 600;
line-height: 28px;
}
.ck-content .avoindata-note-content {
font-size: 18px;
font-weight: 400;
line-height: 27px;
padding: 0 20px 15px;
}
.ck-content .avoindata-expander-content p:last-of-type,
.ck-content .avoindata-hint-content p:last-of-type,
.ck-content .avoindata-note-content p:last-of-type {
margin-bottom: 0;
.ck-content .avoindata-note-content p {
font-size: 18px;
font-weight: 400;
line-height: 27px;
}
.ck-content .avoindata-hint {
margin: 20px 0;
Expand All @@ -349,7 +400,12 @@ a.external svg {
line-height: 27px;
padding: 0 20px 15px 15px;
}
.ck-content .avoindata-example {
.ck-content .avoindata-hint-content p {
font-size: 18px;
font-weight: 400;
line-height: 27px;
}
.ck-content .avoindata-example p {
background: #fff;
border-radius: 2px;
border: 1.5px solid #2a6ebb;
Expand All @@ -358,52 +414,21 @@ a.external svg {
margin-bottom: 20px;
display: block;
}
.ck-content .avoindata-example-title {
.ck-content .avoindata-example-title p {
margin: 0;
font-size: 16px;
font-weight: 600;
line-height: 24px;
padding: 20px 20px 6px;
display: block;
}
.ck-content .avoindata-example-title > :last-child {
margin: 0;
}
.ck-content .avoindata-example-content {
.ck-content .avoindata-example-content p {
font-size: 16px;
font-weight: 400;
line-height: 24px;
padding: 0 20px 20px;
display: block;
}
.ck-content .avoindata-section {
background-color: #fff;
box-shadow: 0 2px 4px 1px rgba(41,41,41,.2);
border-top: 4px solid #2a6ebb;
border-radius: 4px 4px 0 0;
margin: 45px 0;
padding: 30px;
display: block;
}
.ck-content .avoindata-section:first-of-type {
margin-top: 0;
}
.ck-content .avoindata-section .avoindata-section-title {
margin-top: 0;
margin-bottom: 20px;
display: block;
}
.ck-content .avoindata-section .avoindata-section-title > p {
margin: 0;
font-size: 22px;
line-height: 34px;
font-weight: 600;
}
.ck-content .avoindata-section .avoindata-section-content > p {
margin: 0 0 27px;
font-size: 18px;
line-height: 27px;
font-weight: 400;
}
.avoindata-section-id-form {
padding: 8px;
}
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -154,24 +154,25 @@ export default class AvoindataExpanderEditing extends Plugin {
conversion.for('dataDowncast').elementToStructure({
model: 'avoindataExpanderTitle',
view: (modelElement, { writer }) => {
return writer.createContainerElement('div', { class: 'avoindata-expander-header' }, [
return writer.createContainerElement('button', { class: 'avoindata-expander-header', 'aria-expanded': false, role: 'button' }, [
writer.createContainerElement('div', { class: 'avoindata-expander-title' }, [
writer.createSlot()
]),
writer.createContainerElement('span', { class: 'icon-wrapper pull-right' }, [
writer.createContainerElement('span', { class: 'icon-wrapper pull-right', 'aria-hidden': true }, [
writer.createEmptyElement('i', { class: 'fas fa-angle-down' })
])
])
}
});

// Instances of <avoindataExpanderContent> are saved as
// <div class="savoindata-expander-content">{{inner content}}</div>.
// <div class="avoindata-expander-content">{{inner content}}</div>.
conversion.for('dataDowncast').elementToElement({
model: 'avoindataExpanderContent',
view: {
name: 'div',
classes: 'avoindata-expander-content',
attributes: { role: 'region' }
},
});

Expand Down
Loading
Loading