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

refactor styling of checkboxes #224

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
8 changes: 7 additions & 1 deletion views/builder/index.jade
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ block main

label
input(type="checkbox", name="minified", value="1")
span
| Download minified source code
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't the text be inside the <span>?

Copy link
Member Author

Choose a reason for hiding this comment

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

@arian no, the span is just a "holder" for the square showing the "selected"/"not selected" state. So the idea is having the span replacing the checkbox itself that was hard to style and is now display: none;


label
input(type="checkbox", name="compat", value="1")
span
| Download with compat layer

if project != 'Core'
Expand Down Expand Up @@ -56,7 +58,9 @@ block main
- var hashRequested = hashDependencies.indexOf(file) != -1;
tr
td
input(type="checkbox", value=file, name="modules[]", data-provides="#{yaml.prov}", data-requires="#{yaml.req}", checked=hashRequested, class=hashRequested ? "activeChoice" : "")
label
input(type="checkbox", value=file, name="modules[]", data-provides="#{yaml.prov}", data-requires="#{yaml.req}", checked=hashRequested, class=hashRequested ? "activeChoice" : "")
span
td #{module}
td #{yaml.prov}
td #{yaml.desc}
Expand All @@ -66,10 +70,12 @@ block main
.save
label
input(type="checkbox", name="minified", value="1")
span
| Download minified source code

label
input(type="checkbox", name="compat", value="1")
span
| Download with compat layer

if project != 'Core'
Expand Down
8 changes: 2 additions & 6 deletions views/css/builder.styl
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@
select
width 100%

input[type="checkbox"]
margin-right 0.5em
vertical-align bottom

input[type="submit"]
margin-top 0.5em
padding 0.5em
Expand Down Expand Up @@ -65,10 +61,10 @@
tr
border-bottom 1px solid #acaaa7
td
padding .3em
padding .4em

&:first-child
width 5%
width 3%
& + td
width 15%
& + td + td
Expand Down
34 changes: 19 additions & 15 deletions views/css/global.styl
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,21 @@ label
select:after
content "stocazzo"

input[type="checkbox"]
height 1em
position relative
width 1em
#builderOptions table input[type="checkbox"]
&:checked,
&.dependency
background #f4f1ed
&.activeChoice:checked
background #7d8aa5

.builder
input[type="checkbox"] + span
border solid #e5e3df 1px
border-radius 3px
padding 1px 8px
margin-right 5px
font-size 13px
input[type="checkbox"]
display none

&.dependency + span
background #f4f1ed
&:checked + span, &.activeChoice:checked + span
background #7d8aa5

input[type="submit"]
background #f4f1ed
Expand Down Expand Up @@ -367,7 +372,7 @@ a:focus .icon

a:focus, a:active
background-color #777571 !important

hr
margin-top 2em
margin-bottom 2em
Expand All @@ -381,7 +386,7 @@ a:focus .icon
margin-left -0.2em
h4
font-weight 400

ul
padding-left 2em
li
Expand Down Expand Up @@ -480,7 +485,7 @@ a:focus .icon
.about
background-color #ffffff
padding-top 0em
a
a
font-weight 400
.cover
float right
Expand All @@ -505,7 +510,6 @@ a:focus .icon
font-weight 200
h3
color #575551

p
padding-top 0.5em