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

Feature/design basics #29

Merged
merged 7 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
149 changes: 77 additions & 72 deletions templates/component/_item.html.twig
Original file line number Diff line number Diff line change
@@ -1,74 +1,79 @@
<div class="twig-doc-component">
<div class="twig-doc-component-description">
<h3>{{ component.title }} ({{ component.projectPath ?? (component.name ~ '.html.twig') }})</h3>
<div class="twig-doc-component-configuration">
<div>
<h4>Description</h4>
<p>{{ component.description }}</p>
</div>
<div>
<h4>Parameters</h4>
<ul>
{% for key, type in component.parameters %}
<li>
<b>{{ key }}:</b>
{% include '@TwigDoc/component/_parameter.html.twig' with {parameter: type} %}
</li>
{% endfor %}
</ul>
</div>
<div>
<h4>Category</h4>
<p>
<a href="{{ path('twig_doc_home', {'filterQuery': component.mainCategory.name, 'filterType': 'category'}) }}">{{ component.mainCategory.name }}</a>
</p>
</div>
<div>
<h4>Sub-Category</h4>
{% if component.category.parent %}
<p>
<a href="{{ path('twig_doc_home', {'filterQuery': component.category.name, 'filterType': 'sub_category' }) }}">
{{ component.category.name }}
</a>
</p>
{% else %}
<p>NONE</p>
{% endif %}
</div>
<div>
<h4>Tags</h4>
{% for tag in component.tags %}
<p>
<a href="{{ path('twig_doc_home', {'filterQuery': tag, 'filterType': 'tag'}) }}">{{ tag }}</a>
</p>
{% endfor %}
</div>
</div>
<div class="twig-doc-component-examples">
<h4>Previews</h4>
<div class="twig-doc-variation">
{% for name, variation in component.variations %}
<h5{% if loop.first %} class="active"{% endif %} data-variation="{{ name }}">{{ name }}</h5>
{% endfor %}
{% for name, variation in component.variations %}
<div class="twig-doc-variation-body{% if loop.first %} active{% endif %}" data-variation="{{ name }}">
<div class="twig-doc-viewport-width-display">Viewport size: <span class="twig-doc-viewport-width-value"></span>px</div>
<div class="twig-doc-viewport-container">
{% include '@TwigDoc/component/_viewport.html.twig' with {component: component, componentData: variation ?? []} %}
</div>
<div class="twig-doc-variation-description">
<ul>
{% for name, value in variation %}
<li>
<b>{{ name }}:</b>
{% include '@TwigDoc/component/_parameter.html.twig' with {parameter: value} %}
</li>
{% endfor %}
</ul>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
<div class="twig-doc-component-description">
<h3>{{ component.title }}
({{ component.projectPath ?? (component.name ~ '.html.twig') }})</h3>
<div class="twig-doc-component-configuration">
<div>
<h4>Description</h4>
<p>{{ component.description }}</p>
</div>
<div>
<h4>Parameters</h4>
<ul>
{% for key, type in component.parameters %}
<li>
<b>{{ key }}:</b>
{% include '@TwigDoc/component/_parameter.html.twig' with {parameter: type} %}
</li>
{% endfor %}
</ul>
</div>
<div>
<h4>Category</h4>
<p>
<a href="{{ path('twig_doc_home', {'filterQuery': component.mainCategory.name, 'filterType': 'category'}) }}">{{ component.mainCategory.name }}</a>
</p>
</div>
<div>
<h4>Sub-Category</h4>
{% if component.category.parent %}
<p>
<a href="{{ path('twig_doc_home', {'filterQuery': component.category.name, 'filterType': 'sub_category' }) }}">
{{ component.category.name }}
</a>
</p>
{% else %}
<p>NONE</p>
{% endif %}
</div>
<div>
<h4>Tags</h4>
{% for tag in component.tags %}
<p>
<a href="{{ path('twig_doc_home', {'filterQuery': tag, 'filterType': 'tag'}) }}">{{ tag }}</a>
</p>
{% endfor %}
</div>
</div>
<div class="twig-doc-component-examples">
<h4>Previews</h4>
<div class="twig-doc-variations">
{% for name, variation in component.variations %}
<div class="twig-doc-variation">
<h5 class="active" data-variation="{{ name }}">{{ component.title }}-Variation:
{{ name }}</h5>
{# {% endfor %}
{% for name, variation in component.variations %} #}
<div class="twig-doc-variation-body active" data-variation="{{ name }}">
<div class="twig-doc-viewport-width-display">Viewport size:
<span class="twig-doc-viewport-width-value"></span>px</div>
<div class="twig-doc-viewport-container">
{% include '@TwigDoc/component/_viewport.html.twig' with {component: component, componentData: variation ?? []} %}
</div>
<div class="twig-doc-variation-description">
<ul>
{% for name, value in variation %}
<li>
<b>{{ name }}:</b>
{% include '@TwigDoc/component/_parameter.html.twig' with {parameter: value} %}
</li>
{% endfor %}
</ul>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
34 changes: 18 additions & 16 deletions templates/component/_search.html.twig
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<form action="{{ path('twig_doc_home') }}" method="get" name="twig_doc_search_form">
<label for="twig_doc_search_form_filterQuery">Search</label>
<input name="filterQuery" id="twig_doc_search_form_filterQuery" value="{{ filterQuery }}" autocomplete="off"/>
<label for="twig_doc_search_form_filterType">What</label>
<select name="filterType" id="twig_doc_search_form_filterType">
<option {{ filterType ? null : 'selected' }} value="">Everything</option>
<option {{ filterType == 'category' ? 'selected' : null }} value="category">Category</option>
<option {{ filterType == 'name' ? 'selected=selected' : null }} value="name">Component Name</option>
<option {{ filterType == 'tags' ? 'selected' : null }} value="tags">Tags</option>
<option {{ filterType == 'sub_category' ? 'selected' : null }} value="sub_category">Sub-Category</option>
</select>
<button type="submit" class="btn btn-primary">Search</button>
{% if filterQuery %}
<a href="{{ path('twig_doc_home') }}">Show all</a>
{% endif %}
</form>
<div class="twig-doc-search-container">
<form action="{{ path('twig_doc_home') }}" method="get" name="twig_doc_search_form">
<label for="twig_doc_search_form_filterQuery">Search</label>
<input name="filterQuery" id="twig_doc_search_form_filterQuery" value="{{ filterQuery }}" autocomplete="off"/>
<label for="twig_doc_search_form_filterType">What</label>
<select name="filterType" id="twig_doc_search_form_filterType">
<option {{ filterType ? null : 'selected' }} value="">Everything</option>
<option {{ filterType == 'category' ? 'selected' : null }} value="category">Category</option>
<option {{ filterType == 'name' ? 'selected=selected' : null }} value="name">Component Name</option>
<option {{ filterType == 'tags' ? 'selected' : null }} value="tags">Tags</option>
<option {{ filterType == 'sub_category' ? 'selected' : null }} value="sub_category">Sub-Category</option>
</select>
<button type="submit" class="btn btn-primary">Search</button>
{% if filterQuery %}
<a href="{{ path('twig_doc_home') }}">Show all</a>
{% endif %}
</form>
</div>
96 changes: 75 additions & 21 deletions templates/style/style.css.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
body {
padding: 0;
margin: 0;
}

#twig-doc-container {
margin-top: 60px;
margin-top: 27px;
}
#twig-doc-container .breakpoints {
position: fixed;
Expand All @@ -26,7 +31,7 @@
flex-grow: 1;
}

.twig-doc-navigation {
#twig-doc-container .navigation {
position: fixed;
left: 0;
top: 0;
Expand All @@ -37,28 +42,28 @@
z-index: 100;
}

.twig-doc-navigation ul {
#twig-doc-container .navigation ul {
display: flex;
position: relative;
flex-direction: row;
{# margin-bottom: 25px; #}
}

.twig-doc-navigation ul ul {
#twig-doc-container .navigation ul ul {
display: none;
position: absolute;
}

.twig-doc-navigation li {
#twig-doc-container .navigation li {
list-style: none;
}

.twig-doc-navigation li a {
#twig-doc-container .navigation li a {
padding: 5px 15px;
}


.twig-doc-navigation li:hover ul {
#twig-doc-container .navigation li:hover ul {
display: flex;
}

Expand All @@ -70,11 +75,13 @@
border-radius: 20px;
}
#twig-doc-container .twig-doc-component-description {
padding: 20px;
//padding: 20px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These do not comment out code in css

Suggested change
//padding: 20px;
/*padding: 20px;*/

}

#twig-doc-container .twig-doc-component-description h3 {
text-transform: none;
padding: 0 20px;
margin: 0;
}
#twig-doc-container .twig-doc-component-description p,
#twig-doc-container .twig-doc-variation-description p {
Expand All @@ -83,16 +90,24 @@
}
#twig-doc-container .twig-doc-component-description h4 {
margin-top: 15px;
margin-bottom: 0px;
}

#twig-doc-container .twig-doc-component-description h4:first-child {
margin-top: 0;
}

#twig-doc-container .twig-doc-component-description ul {
padding-top: 0;
margin-top: 0;
margin-left: 0;
padding-left: 15px;
}

#twig-doc-container .twig-doc-component-configuration {
display: flex;
flex-direction: row;
padding-top: 20px;
padding: 20px 20px 0 20px;
gap: 50px;
}
#twig-doc-container .twig-doc-component-configuration div {
Expand All @@ -113,12 +128,13 @@
margin-bottom: 20px;
}

#twig-doc-container .twig-doc-variation .twig-doc-variation-description {
#twig-doc-container .twig-doc-variation .twig-doc-variation-description,
#twig-doc-container .twig-doc-variation .twig-doc-viewport-width-display {
padding-left: 20px;
}

.twig-doc-body {
padding: 15px;
//padding: 15px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These do not comment out code in css

Suggested change
//padding: 15px;
/*padding: 20px;*/

}

.twig-doc-variation h5 {
Expand All @@ -127,12 +143,6 @@
display: inline-block;
}

.twig-doc-variation h5:hover, .twig-doc-variation h5.active {
background-color: #000000;
color: #ffffff;
cursor: pointer;
}

.twig-doc-variation-body {
display: none;
}
Expand All @@ -146,7 +156,6 @@
flex-direction: column;
flex-grow: 1;
border: none;
padding: 10px;
position: relative;
overflow-x: scroll;
}
Expand All @@ -155,18 +164,63 @@
display: flex;
flex-direction: column;
flex-grow: 1;
min-width: 240px;
margin: 0 auto;
/* min-width: 240px; */
width: 100%;
margin: 0;
white-space: nowrap;
text-align: center;
position: relative;
resize: horizontal;
overflow-x: auto;
outline: 1px solid #000000;
}

.twig-doc-iframe {
width: 100%;
flex-grow: 1;
border: 0;
background: white;
margin: 10px 0;
}

.twig-doc-navigation {
position: fixed;
left: 0;
top: 0;
width: 100%;
background: white;
text-align: center;
border-bottom: 1px darkgray solid;
z-index: 100;
}

.twig-doc-navigation ul {
display: flex;
position: relative;
flex-direction: row;
}

.twig-doc-navigation ul ul {
display: none;
position: absolute;
border: 1px darkgray solid;
border-top: none;
background: white;

}

.twig-doc-navigation li {
list-style: none;
}

.twig-doc-navigation li a {
display: inline-block;
padding: 5px 15px;
}


.twig-doc-navigation li:hover ul {
display: flex;
}
.twig-doc-search-container {
padding: 20px 0 20px 15px;
}
Loading
Loading