3 #components Components
Framework independent CSS components
src/css/components/index.less
, line 1
3.1 #components.avatar .avatar
Simple avatar picture, whose size can be modified
<img class="avatar size-m" src="...">
Markup
<img class="avatar [modifier class]" src="https://community.windy.com/assets/uploads/profile/603905-profileavatar.png">
src/css/components/avatar.less
, line 1
3.2 #components.avatar-wrapper .avatar-wrapper
Complete avatar picture, witch Premium and number badge, whose size can be modified.
<div class="avatar-wrapper size-m">
<img class="avatar" src="...">
<div class="avatar-wrapper__badge">5</div>
<div class="avatar-wrapper__premium-logo" />
</div>
Markup
<div style="margin: 20px; display: block;">
<div class="avatar-wrapper [modifier class]">
<img class="avatar"
src="https://community.windy.com/assets/uploads/profile/603905-profileavatar.png"
alt="Users username" />
<div class="avatar-wrapper__badge">5</div>
<div class="avatar-wrapper__premium-logo" />
</div>
</div>
src/css/components/avatar.less
, line 27
3.3 #components.badge .badge
Small textual badge. Use our color, and size classes to set the color and size.
<span class="badge fg-white bg-red size-xs">info</span>
Markup
<span class="badge [modifier class] fg-white bg-red">info</span>
src/css/components/badge.less
, line 1
3.3.1 #components.badge.00 .flying-conditions
Special type of badge, used to display flying conditions.
<span class="flying-conditions flying-conditions--V">info</span>
Markup
<span class="flying-conditions [modifier class] size-xs"></span>
src/css/components/badge.less
, line 29
3.4 #components.bbox .bordered-box
just bordered box
Markup
<div class="bordered-box">This is hook element
Lorem ipsum, lorem, ipsum</div>
src/css/components/window.less
, line 1
3.6 #components.card .card
Card with a picture on a left.
<div class="card">
<div class="card__wrapper">
<div class="card__image" style="background-image:url('...')">
<!-- place badges here -->
<span class="badge fg-white size-xs bg-red">bdg 1</span>
<span class="badge fg-white size-xs bg-orange">bdg 2</span>
</div>
<div class="card__content">
<div class="card__title">
Card Title
</div>
Content goes here
<div class="card__buttons">
<!-- Many .button classes if needed -->
<div class="button">Button 1</div>
<div class="button">Button 2</div>
</div>
</div>
</div>
</div>
Markup
<section class="mt-10 mb-10 bg-white rounded-box">
<div class="card [modifier class]" style="max-width: 420px;">
<div class="card__wrapper">
<div class="card__image" style="background-image:url('<!-- @echo IMG_GALLERY_PATH -->/howto/Screenshot-2019-08-16-at-16.52.29.png?w=300')">
<!-- palce badges here -->
<span class="badge fg-white size-xs bg-red">bdg 1</span>
<span class="badge fg-white size-xs bg-orange">bdg 2</span>
</div>
<div class="card__content">
<div class="card__title">
Card Title
</div>
Content goes here
<div class="card__buttons">
<!-- Many .button classes if needed -->
<div class="button">Button 1</div>
<div class="button">Button 2</div>
</div>
</div>
</div>
</div>
</section>
<section class="mt-10 mb-10 fg-gray-light bg-gray-dark rounded-box dark-content">
<div class="card [modifier class]" style="max-width: 420px;">
<div class="card__wrapper">
<div class="card__image" style="background-image:url('<!-- @echo IMG_GALLERY_PATH -->/howto/Screenshot-2019-08-16-at-16.52.29.png?w=300')">
<!-- palce badges here -->
<span class="badge fg-white size-xs bg-red">bdg 1</span>
<span class="badge fg-white size-xs bg-orange">bdg 2</span>
</div>
<div class="card__content">
<div class="card__title">
Card Title
</div>
Content goes here
<div class="card__buttons">
<!-- Many .button classes if needed -->
<div class="button button--variant-orange">Button 1</div>
<div class="button button--variant-orange">Button 2</div>
</div>
</div>
</div>
</div>
</section>
src/css/components/card.less
, line 1
3.7 #components.checkbox .checkbox
Custom checkbox with associated text. By default is on.
<div class="checkbox {{modifier_class}}">This is my custom checkbox</div>
Markup
<div class="rounded-box m-15 bg-white fg-gray">
<div class="checkbox [modifier class]">This is my custom checkbox</div>
</div>
<div class="rounded-box m-15 bg-gray-dark fg-gray-light">
<div class="checkbox [modifier class]">This is my custom checkbox</div>
</div>
src/css/components/checkbox.less
, line 1
3.7.1 #components.checkbox.play-pause .play-pause
Reusable play pause icon as a special variant of checkbox.
Markup
<div class="rounded-box m-15 bg-gray-dark fg-gray-light">
<div class="play-pause [modifier class] m-20 size-ultra"></div>
</div>
src/css/components/play-pause.less
, line 1
3.8 #components.closingX .closing-x
TODO: Refactor as part of window / plugin classes
Basic closing element, by default in rh corner of its parent element. By default it has display: none
and must
be made visible manually upon opening window or whatever.
Markup
<div class="closing-x" style="display: block; position: relative;"></div>
src/css/components/closing-x.less
, line 1
3.10 #components.form .form-group
Basic form group
Markup
<div class="form-group [modifier class]">
<label>Name</label>
<input type="text" placeholder="Name">
<small>This is a note or error message</small>
</div>
src/css/components/forms.less
, line 1
3.12 #components.rbox .rounded-box
Just box with rounded square
Markup
<div class="rounded-box bg-red fg-white size-xs [modifier class]">
hello world. This is just box with rounded square. Just box with rounded squareJust box with rounded squareJust box with rounded squareJust box with rounded squareJust box with rounded square</div>
src/css/components/rounded-box.less
, line 8
3.13 #components.scroll Scrolling
Customm scrollbars
src/css/components/scroll.less
, line 1
3.13.1 #components.scroll.custom-scrollbar .custom-scrollbar
Styles vertical scrollbar so it has decent and uniform look on all browsers.
src/css/components/scroll.less
, line 33
3.13.2 #components.scroll.horizontal .horizontal-scroll
Implements horizontal scrolling with hidden scrollbar, that should be used for touch devices, where some content exceeds width of a device.
src/css/components/scroll.less
, line 10
3.14 #components.sinput .search-input
Unified search input with cancel button, so far prepared only for dark mode.
<div class="search-input">
<input type="text" placeholder="Search something..." />
<div class="search-input__cancel fg-white">Cancel search</div>
</div>
Markup
<div class="search-input rounded-box bg-gray-dark" style="max-width: 400px;">
<input type="text" placeholder="Search something..." />
<div class="search-input__cancel fg-white">Cancel search</div>
</div>
src/css/components/search-input.less
, line 1
3.15 #components.switch .switch
UI switch component.
To change background of non selected items use .bg-
class.
Use our handy .size-
classes to change the size of the switch.
<nav class="switch switch--variant-red-light size-s">
<a class="switch__item selected">first option</a>
<a class="switch__item">second option</a>
<a class="switch__item">third option</a>
</nav>
Markup
<section class="mt-10 mb-10 bg-white rounded-box">
Light mode:
<div class="m-20 mb-40">
<nav class="switch [modifier class] fg-gray-dark bg-gray-light">
<a class="switch__item selected">first option</a>
<a class="switch__item">second option</a>
<a class="switch__item">third option</a>
</nav>
</div>
<div class="m-20 mb-40">
<nav class="switch [modifier class] fg-gray">
<a class="switch__item selected">first option</a>
<a class="switch__item">second option</a>
<a class="switch__item">third option</a>
</nav>
</div>
</section>
<section class="mt-10 mb-10 fg-gray-light bg-gray-dark rounded-box dark-content">
Dark mode:
<div class="m-20 mb-40">
<nav class="switch [modifier class] bg-gray">
<a class="switch__item selected">first option</a>
<a class="switch__item">second option</a>
<a class="switch__item">third option</a>
</nav>
</div>
<div class="m-20 mb-40">
<nav class="switch [modifier class]">
<a class="switch__item selected">first option</a>
<a class="switch__item">second option</a>
<a class="switch__item">third option</a>
</nav>
</div>
</section>
src/css/components/switch.less
, line 1
3.15.1 #components.switch.01 Switch sizes
Use our handy .size-
classes to change size of the switch.
Markup
<nav class="switch switch--color-red-light [modifier class] fg-gray-dark bg-gray-light">
<a class="switch__item selected">first option</a>
<a class="switch__item">second option</a>
<a class="switch__item">third option</a>
</nav>
src/css/components/switch.less
, line 166
3.15.2 #components.switch.3 .switch-mobile-wrapper
Wraps .switch
on mobileTablet
device to fill 100% of width
with possibillity of horizontal scroll, if size of the switch
exceeds the width of the screen.
<div class="switch-mobile-wrapper">
<nav class="switch switch--variant-uiswitch">
<a class="switch__item selected">first option</a>
<a class="switch__item">second option</a>
<a class="switch__item">third option</a>
</nav>
</div>
Markup
<section id="device-mobile">
<div class="switch-mobile-wrapper">
<nav class="switch switch--variant-uiswitch">
<a class="switch__item selected">first option</a>
<a class="switch__item">second option</a>
<a class="switch__item">third option</a>
</nav>
</div>
</section>
src/css/components/switch-mobile-wrapper.less
, line 1
3.16 #components.tooltip [data-tooltip]
CSS only on hover tooltip (works on desktop only).
Use data-tooltip="text"
or data-tooltip-src="PHRASE"
for untranslated phrase.
By default displays tooltip bellow parent component, otherwise use .tooltip--
positioning classes.
Tooltip uses ::after
pseudo class so it can be combined with data-icon
<span class="btn clickable tooltip--left"
data-tooltip="This is tooltip">Hover over me</span>
Markup
<div class="centered">
<span class="btn clickable [modifier class]"
data-tooltip="This is tooltip">Hover over me</span>
</div>
src/css/components/data-tooltip.less
, line 1
3.17 #components.window .window
White information window with rounded corners, absolutely positioned. Requires
open
or show
class to become visible, and to set up width. closing-x
element is
optional.
Markup
<div class="btn" style="margin: 100px 0;">This is hook element
<div class="window open">
<div class="closing-x"></div>
Lorem ipsum, lorem, ipsum</div>
</div>
src/css/components/window.less
, line 18
3.18 #components.window2 .drop-down-window
White information widnow with rounded corners, relativelly positioned. Requires
open
class to become visible, and to set up width.
Markup
<div class="btn" style="margin: 100px 0;">This is hook element
<div class="drop-down-window [modifier class] open">
<div class="closing-x"></div>
Lorem ipsum, lorem, ipsum</div>
</div>
src/css/components/window.less
, line 80